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 select specific columns with csvkit?
- How to rename a column with csvkit?
- How to fetch unique values with csvkit?
- How to convert a tsv file to csv with csvkit?
- How to split a csv file with csvkit?
- How to reorder columns with csvkit?
- How to merge columns with csvkit?
- How to remove duplicates with csvkit?
- How to skip the first line with csvkit?
- How to use csvkit on Windows?
See more codes...