csvcut
all
Filter and truncate CSV files. Like Unix's `cut` command, but for tabular data. Included in csvkit.
More info →Options (3)
-n, --namesbooleanPrint indices and names of all columns
Example:
csvcut {{[-n|--names]}} {{data.csv}}-c, --columnsbooleanExtract the first and third columns
Example:
csvcut {{[-c|--columns]}} {{1,3}} {{data.csv}}-C, --not-columnsbooleanExtract all columns except the fourth one
Example:
csvcut {{[-C|--not-columns]}} {{4}} {{data.csv}}Examples (4)
Print indices and names of all columns
csvcut [-n|--names] data.csvExtract the first and third columns
csvcut [-c|--columns] 1,3 data.csvExtract all columns except the fourth one
csvcut [-C|--not-columns] 4 data.csvExtract the columns named "id" and "first name" (in that order)
csvcut [-c|--columns] id,"first name" data.csvmade by @shridhargupta | data from tldr-pages