csvtools icon indicating copy to clipboard operation
csvtools copied to clipboard

csvlook implementation

Open kadwanev opened this issue 8 years ago • 7 comments

Add ability to space out columns so they are easy to look at.

For delight: cat file.csv | csvcut -K 0,1 | csvlook

kadwanev avatar Nov 03 '16 18:11 kadwanev

How awesome!

I have some questions:

  • Could you merge with the current upstream? It's your code, and you'll know best how to merge it.
  • Can you add test for csvlook and the handling of the tab as separator in the other programs?

If you have questions on how to add tests, I'll be happy to point you in the right way.

DavyLandman avatar Nov 03 '16 19:11 DavyLandman

Codecov Report

Merging #13 into master will decrease coverage by 5.56%. The diff coverage is 15.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
- Coverage   69.45%   63.89%   -5.57%     
==========================================
  Files           7        8       +1     
  Lines         848      950     +102     
  Branches      186      214      +28     
==========================================
+ Hits          589      607      +18     
- Misses        197      280      +83     
- Partials       62       63       +1
Impacted Files Coverage Δ
src/csvawk.c 51.03% <0%> (-0.02%) :arrow_down:
src/csvgrep.c 71.68% <0%> (-0.32%) :arrow_down:
src/csvcut.c 67.02% <0%> (-0.37%) :arrow_down:
src/csvlook.c 16.49% <16.49%> (ø)
src/csv_tokenizer.c 81.93% <0%> (+0.11%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 31caeb6...eed0f64. Read the comment docs.

codecov-io avatar Nov 03 '16 19:11 codecov-io

Current coverage is 64.05% (diff: 16.34%)

Merging #13 into master will decrease coverage by 5.39%

@@             master        #13   diff @@
==========================================
  Files             7          8     +1   
  Lines           848        946    +98   
  Methods          51         56     +5   
  Messages          0          0          
  Branches        186        213    +27   
==========================================
+ Hits            589        606    +17   
- Misses          197        277    +80   
- Partials         62         63     +1   

Powered by Codecov. Last update 31caeb6...efe7ca7

codecov-io avatar Nov 03 '16 19:11 codecov-io

Hi Davy,

I won't be able to add test coverage. I'll leave it in your capable hands now.

kadwanev avatar Nov 03 '16 20:11 kadwanev

hmm, what should happen if a quoted cell contains a newline?

DavyLandman avatar Nov 03 '16 20:11 DavyLandman

For cvslook, I think quotes should be removed, newlines should be stripped, etc. You're trying to take a quick look at the data perhaps after grep or cut. Come to think of it, I think default should stop after about 20 rows with a parameter to continue on the full file.

kadwanev avatar Nov 03 '16 21:11 kadwanev

I like the feature of stopping after n rows, perhaps it should be renamed to csvhead?

DavyLandman avatar Nov 04 '16 15:11 DavyLandman