.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "CSVSORT" "1" "Jul 12, 2024" "2.0.1" "csvkit" .SH NAME csvsort \- csvsort Documentation .SH DESCRIPTION .sp Sort CSV files. Like the Unix \(dqsort\(dq command, but for tabular data: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C 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 \(dqsort\(dq command, but for tabular data. positional arguments: FILE The CSV file to operate on. If omitted, will accept input as piped data via STDIN. optional arguments: \-h, \-\-help show this help message and exit \-n, \-\-names Display column names and indices from the input CSV and exit. \-c COLUMNS, \-\-columns COLUMNS A comma\-separated list of column indices, names or ranges to sort by, e.g. \(dq1,id,3\-5\(dq. Defaults to all columns. \-r, \-\-reverse Sort in descending order. \-i, \-\-ignore\-case Perform case\-independent sorting. \-y SNIFF_LIMIT, \-\-snifflimit SNIFF_LIMIT Limit CSV dialect sniffing to the specified number of bytes. Specify \(dq0\(dq to disable sniffing. \-I, \-\-no\-inference Disable type inference when parsing the input. .ft P .fi .UNINDENT .UNINDENT .sp See also: \fI\%Arguments common to all tools\fP\&. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If your file is large, try \fBsort \-t, file.csv\fP instead. .UNINDENT .UNINDENT .SH EXAMPLES .sp Sort the veteran\(aqs education benefits table by the \(dqTOTAL\(dq column: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C csvsort \-c 9 examples/realdata/FY09_EDU_Recipients_by_State.csv .ft P .fi .UNINDENT .UNINDENT .sp View the five states with the most individuals claiming veteran\(aqs education benefits: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C csvcut \-c 1,9 examples/realdata/FY09_EDU_Recipients_by_State.csv | csvsort \-r \-c 2 | head \-n 5 .ft P .fi .UNINDENT .UNINDENT .SH AUTHOR Christopher Groskopf and contributors .SH COPYRIGHT 2016, Christopher Groskopf and James McKinney .\" Generated by docutils manpage writer. .