CSVSORT(1)
π CSVSORT(1) π
okay bestie, welcome to csvsort, part of the csvkit family π
β¨ NAME β¨
csvsort β literally just the csvsort Documentation, no cap π«Ά
πΈ DESCRIPTION πΈ
It sorts CSV files. Like the Unix sort command, but make it tabular data β¨ Same energy, cuter payload π
usage: csvsort [-h] [-d DELIMITER] [-t] [-q QUOTECHAR] [-u {0,1,2,3}] [-b]
[-p ESCAPECHAR] [-z FIELD_SIZE_LIMIT] [-e ENCODING] [-L LOCALE]
[-S] [--blanks] [--null-value NULL_VALUES [NULL_VALUES ...]]
[--date-format DATE_FORMAT] [--datetime-format DATETIME_FORMAT]
[-H] [-K SKIP_LINES] [-v] [-l] [--zero] [-V] [-n] [-c COLUMNS]
[-r] [-i] [-y SNIFF_LIMIT] [-I]
[FILE]
Sort CSV files. Like the Unix "sort" command, but for tabular data.
π positional arguments
FILEβ the CSV file you wanna work on. Skip it and it'll happily take input as piped data via STDIN, slay π¦
π§ optional arguments
-h,--helpβ shows this help message and dips. iconic behaviour honestly β¨-n,--namesβ shows you the column names and indices from the input CSV, then exits. a lil peek at the roster π-c COLUMNS,--columns COLUMNSβ a comma-separated list of column indices, names or ranges to sort by, like"1,id,3-5". defaults to all columns, so if you're indecisive it's got you π-r,--reverseβ sorts in descending order. main character energy, biggest first π€-i,--ignore-caseβ does case-independent sorting.Aandaare besties here, no drama πΈ-y SNIFF_LIMIT,--snifflimit SNIFF_LIMITβ limits CSV dialect sniffing to that many bytes. say"0"to disable sniffing entirely, or"-1"to sniff the entire file. go big or go home fr fr π-I,--no-inferenceβ disables type inference (and also--locale,--date-format,--datetime-format,--no-leading-zeroes) when parsing the input. it just takes everything at face value, no assumptions π₯
See also: Arguments common to all tools. (iykyk β all those other flags up in the usage line live over there π)
NOTE: if your file is large, try sort -t, file.csv instead. fr, that's the move, don't fight it π
π EXAMPLES π
Sort the veteran's education benefits table by the "TOTAL" column:
csvsort -c 9 examples/realdata/FY09_EDU_Recipients_by_State.csv
View the five states with the most individuals claiming veteran's education benefits:
csvcut -c 1,9 examples/realdata/FY09_EDU_Recipients_by_State.csv | csvsort -r -c 2 | head -n 5
π AUTHOR π
Christopher Groskopf and contributors π«Ά
β COPYRIGHT β
2016, Christopher Groskopf and James McKinney
and that's a wrap bestie π this was csvsort, version 2.2.0, dated Aug 16, 2024, straight from the csvkit girlies. go sort something cute π
β¨πΈ
π¦ where this page comes from
- arch rolling: csvkit 2.2.0-2 Β· MIT
- nixos 26.05: csvkit 2.2.0
- nixpkgs unstable: csvkit 2.2.0
- ubuntu resolute: csvkit 2.2.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms