csvkitHow to sort a csv file with csvkit?
csvkit is a suite of command-line tools for working with CSV files. It can be used to sort a csv file.
Example code
csvsort -c column_name input.csv > output.csv
Output example
column_name1,column_name2,column_name3
value1,value2,value3
value4,value5,value6
value7,value8,value9
Code explanation
csvsort
: command to sort a csv file-c
: flag to specify the column to sort bycolumn_name
: the name of the column to sort byinput.csv
: the name of the input csv file>
: redirects the output to a fileoutput.csv
: the name of the output csv file
Helpful links
More of Csvkit
- How to split a csv file with csvkit?
- How to diff two CSV files using csvkit?
- How to update specific records using csvkit?
- How to convert a csv file to tab delimited with csvkit?
- How to convert JSON to CSV using csvkit?
- How to select specific columns with csvkit?
- How to merge columns with csvkit?
- How to convert a tsv file to csv with csvkit?
- How to remove duplicates with csvkit?
- How to fetch unique values with csvkit?
See more codes...