This site is now archived and read-only. The source code can be found at github.com/datopian/datapipes.

Data Pipes

grep

Filter data to only those rows where certain columns match a pattern.

Usage

grep [-iv] [-e pattern] [-c columns] [PATTERN]

-c COLUMNS, --columns COLUMNS
    comma-separated list of columns to search.

-e PATTERN, --regexp PATTERN
    The regular expression to search for.

-i, --ignore-case
    Perform case-insensitive pattern matching.

-v, --invert-match
    Return the rows that do __not__ match the regular
    expression.

Examples

Return only those rows containing LONDON:

/csv/grep LONDON?url=http://static.london.gov.uk/gla/expenditure/docs/2012-13-P12-250.csv

Return only those rows that do not mention LONDON (piped through html):

/csv/grep -v LONDON/html/?url=http://static.london.gov.uk/gla/expenditure/docs/2012-13-P12-250.csv