Project Description
Command line tools to process CSV files.
The goal is to support the basic relational operations. Currently supported is selection and projection.

Processing CSV files

The CSV Relation tools are written for relational processing of CSV files. For relational algebra theory take a look at CSV Relation contains an individual command line tool for a relational operation. Currently only projection and selection is implemented. A very useful extension would be rename and at least one form of join.


To rearrange the columns of a CSV file, a projection is needed and thereby the tool CsvProject.exe is used. To run a projection query on a CSV file called data.csv which extracts the columns 'A' and 'B' you need to create a text file e.g. proj-query.txt with the following content:

and call CsvProject.exe on the command line:

> CsvProject proj-query.txt data.csv data-result.csv


To filter the rows of a CSV file by some criteria, a selection is needed and thereby the tool CsvSelect.exe is used. To run a selection query on a CSV file called data.csv which selects all rows where column B contains a number larger than 10 or column A contains the string 'pass' you need to create a text file e.g. select-query.txt with the following content:

B:int, >, 10
A:string, =, pass
and call CsvSelect.exe on the command line:

> CsvSelect select-query.txt data.csv data-result.csv

To combine more than one criteria as a conjunction you currently need to call CsvSelect.exe once for every criteria. An extension of the query syntax to support explicit AND and OR combinations is considered desirable.

Last edited Apr 16, 2013 at 8:59 AM by cytrek83, version 3