Forrest logo
tool overview
On this page you find all important commands for the CLI tool csvsort. If the command you are looking for is missing please ask our AI.

csvsort

The csvsort command line tool is a powerful utility used to sort CSV (Comma Separated Values) files based on one or more columns. It allows you to rearrange the rows of a CSV file in ascending or descending order based on the values in specific columns.

Some key features of csvsort include:

  1. Column Selection: You can specify the column(s) by which you want to sort the CSV file. If multiple columns are specified, the sorting is applied in order, first by the primary column, then by the secondary column, and so on.

  2. Sorting Order: csvsort supports both ascending and descending sorting orders. By default, it sorts in ascending order, but you can specify the -r flag to enable descending order.

  3. Stability: If two rows have identical values in the column being sorted, csvsort maintains the relative order of these rows to ensure stability in the sorting process.

  4. Support for Large Files: csvsort is designed to handle large CSV files efficiently. It automatically utilizes disk-based sorting when the file size exceeds the available memory, ensuring efficient sorting regardless of the file size.

  5. Custom Delimiters: In addition to comma-separated values, csvsort can handle other delimiters like tab-separated values (TSV) or semicolon-separated values by specifying the delimiter using the -d flag.

  6. Flexibility: csvsort lets you specify the input file and output file, or read from standard input and write to standard output. This flexibility allows integration with other command line tools and enables piping operations.

Overall, csvsort is a useful command line tool for sorting CSV files, providing options for various sorting criteria, customization, and efficient handling of large datasets.

List of commands for csvsort:

  • csvsort:tldr:783fb csvsort: Sort a CSV file by column 9.
    $ csvsort -c ${9} ${data-csv}
    try on your machine
    explain this command
  • csvsort:tldr:b0129 csvsort: Sort a CSV file by the "name" column in descending order.
    $ csvsort -r -c ${name} ${data-csv}
    try on your machine
    explain this command
  • csvsort:tldr:b666a csvsort: Sort a CSV file without inferring data types.
    $ csvsort --no-inference -c ${columns} ${data-csv}
    try on your machine
    explain this command
tool overview