2016-01-21 23:04:19 +00:00
|
|
|
# csvsort
|
|
|
|
|
2024-04-25 23:58:21 +01:00
|
|
|
> Sort CSV files.
|
2016-01-21 23:04:19 +00:00
|
|
|
> Included in csvkit.
|
2019-06-09 00:05:32 +01:00
|
|
|
> More information: <https://csvkit.readthedocs.io/en/latest/scripts/csvsort.html>.
|
2016-01-21 23:04:19 +00:00
|
|
|
|
|
|
|
- Sort a CSV file by column 9:
|
|
|
|
|
|
|
|
`csvsort -c {{9}} {{data.csv}}`
|
|
|
|
|
|
|
|
- Sort a CSV file by the "name" column in descending order:
|
|
|
|
|
|
|
|
`csvsort -r -c {{name}} {{data.csv}}`
|
|
|
|
|
2016-01-21 23:16:56 +00:00
|
|
|
- Sort a CSV file by column 2, then by column 4:
|
2016-01-21 23:04:19 +00:00
|
|
|
|
|
|
|
`csvsort -c {{2,4}} {{data.csv}}`
|
|
|
|
|
|
|
|
- Sort a CSV file without inferring data types:
|
|
|
|
|
|
|
|
`csvsort --no-inference -c {{columns}} {{data.csv}}`
|