9951 explained code solutions for 126 technologies

csvkitHow to sort a csv file with csvkit?

csvkit is a suite of command-line tools for working with CSV files. It can be used to sort a csv file.

Example code

csvsort -c column_name input.csv > output.csv

Output example


Code explanation

  • csvsort: command to sort a csv file
  • -c: flag to specify the column to sort by
  • column_name: the name of the column to sort by
  • input.csv: the name of the input csv file
  • >: redirects the output to a file
  • output.csv: the name of the output csv file

Helpful links

Edit this code on GitHub