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 convert a tsv file to csv with csvkit?
- How to fetch unique values with csvkit?
- How to convert a csv file to tab delimited with csvkit?
- How to split a csv file with csvkit?
- How to remove header with csvkit?
- How to extract a column from a CSV file using csvkit?
- How to remove columns with csvkit?
- How to sort a csv file with csvkit?
- How to remove duplicates with csvkit?
See more codes...