csvsort
Sorts CSV files. Included in csvkit. More information: https://csvkit.readthedocs.io/en/latest/scripts/csvsort.html.
-
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}}
-
Sort a CSV file by column 2, then by column 4:
csvsort -c {{2,4}} {{data.csv}}
-
Sort a CSV file without inferring data types:
csvsort --no-inference -c {{columns}} {{data.csv}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.