csvfilter

A command-line tool and Python API for manipulating CSV data, eg plucking columns and reordering them
Download

csvfilter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Other/Proprietary Li...
  • Price:
  • FREE
  • Publisher Name:
  • David Winterbottom
  • Publisher web site:
  • https://github.com/tangentlabs/

csvfilter Tags


csvfilter Description

csvfilter is a simple Python wrapper around the CSV module to provide a command-line tool for filtering columns from a CSV file. This is useful as standard tools like awk don't account for the quoting and escaping used in CSV files.InstallationFrom PyPi:pip install csvfilterUsagePluck fields 1, 3 and 5:csvfilter -c 1,3,5 in.csv > out.csvPluck all fields apart from column 2:cat in.csv | csvfilter -c 2 -i > out.csvSkip the header row:cat in.csv | csvfilter --skip=1CSV data can be supplied through STDIN or by running csvfilter directly on a file.Help:$ csvfilter --helpUsage: csvfilter Options:-h, --help show this help message and exit-c COLUMNS, --columns=COLUMNS Specify which columns to pluck-s SKIP, --skip=SKIP Number of rows to skip-d DELIMITER, --delimiter=DELIMITER Delimiter of incoming CSV data-i, --inverse Invert the filter - ie drop the selected columnsContributingAfter cloning, install nose and run the test suite using:nosetestsTo experiment with the executable, install in develop mode:./setup.py developand use the fixture files:cat fixtures/au.csv | csvfilter -c 3,1,2 -s 1csvfilter fixutres/au.csv -c 1,2 -iProduct's homepage


csvfilter Related Software