CLI utility for filtering and sorting CSV files.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
.gitignore
LICENSE
README.md

README.md

CsvPal

Command-line utility for filtering and sorting CSV files.

Requirements

This application was written in Python. Python 2.6 is recommended although other 2.x versions may work. The docopt Python library is required.

Installation

To install CsvPal, just add csvpal.py to the PATH (or equivalent configuration).

Example Usage

The following example shows how to filter out two columns (foo and bar) from infile.csv to a new file named outfile.csv:

csvpal infile.csv outfile.csv foo bar

Adding the --sort option will sort the columns in outfile.csv:

csvpal infile.csv outfile.csv foo bar --sort

A "keep file" can be used to specify which columns will be kept in the output file. Each line of the keep file defines a single column to keep. The following example uses the keep file keepers.txt:

csvpal infile.csv outfile.csv --keepfile keepers.txt