csvkitHow to select specific columns with csvkit?
csvkit is a suite of command-line tools for working with CSV, the most popular being csvcut. csvcut allows you to select specific columns from a CSV file.
Example code
csvcut -c 1,3,4 myfile.csv
Output example
column1,column3,column4
value1,value3,value4
value5,value7,value8
Code explanation
csvcut: the command to select specific columns from a CSV file-c: the flag to specify the columns to select1,3,4: the columns to select, in this case columns 1, 3, and 4myfile.csv: the CSV file to select columns from
Helpful links
More of Csvkit
- How to reorder columns with csvkit?
- How to rename a column with csvkit?
- How to specify a delimiter in csvkit?
- How to install csvkit on Archlinux?
- How to convert a tsv file to csv with csvkit?
- How to update specific records using csvkit?
- How to merge columns with csvkit?
- How to sort a csv file with csvkit?
- How to convert a csv file to tab delimited with csvkit?
See more codes...