Have a large ( wide ) csv file and just need to KEEP a few columns

66 views
Skip to first unread message

a200...@gmail.com

unread,
Sep 14, 2015, 12:42:40 PM9/14/15
to csvfix
Hello, I have a very wide csv file, like 75 columns, and I just need about 4 columns out of it. I'm looking for the opposite of -exclude.
It appears especially cumbersome to have to specify all the fields that I do not want. A command line option like -keep 13, 27,43,56 would be especially helpful and more maintainable.

Thanks Alex

Neil Butterworth

unread,
Sep 14, 2015, 1:13:35 PM9/14/15
to csvfix, a200...@gmail.com
Have you looked at the "order" command?

Eric Clay

unread,
Oct 20, 2015, 3:59:24 PM10/20/15
to csvfix, a200...@gmail.com
You can do ranges like 1:12, 14:26, 28:42, 44:55, 57:75

Looking at this more you can also do this: csvfix order -fn "Part No, Valid To" input.csv

Your input file will require headers and it is case sensitive but the above line exported out column 1 and 4.
Reply all
Reply to author
Forward
0 new messages