skip to navigation
skip to content

Not Logged In

csvsort 1.2

Sort large CSV files on disk rather than in memory

CSV Sort

Sort a CSV file on disk rather than in memory. The merge sort algorithm is used to break up the original file into smaller chunks, sort these in memory, and then merge these sorted files.

Example usage:

>>> from csvsort import csvsort
>>> # sort this CSV on the 4th and 2nd columns (columns are 0 indexed)
>>> csvsort('test1.csv', [4,2])
>>> # sort this CSV with no header on 3rd column and save results to separate file
>>> csvsort('test2.csv', [3], output_file='test3.csv', has_header=False)

csvsort can also be used from the command line:

$ # sort this CSV on 0th column
$ python test1.tsv --coloumn=0

$ # sort this tab separated file (TSV) on 3rd and 1st columns
$ python test3.tsv --delimiter='\t' -c 3 -c 1


$ pip install csvsort
File Type Py Version Uploaded on Size
csvsort-1.2.tar.gz (md5) Source 2015-01-26 2KB
  • Downloads (All Versions):
  • 4 downloads in the last day
  • 56 downloads in the last week
  • 218 downloads in the last month