commands.sh

csvgrep

all

Filter CSV rows with string and pattern matching. Included in csvkit.

More info →

Options (4)

-c, --columnsboolean

Find rows that have a certain string in column 1

Example: csvgrep {{[-c|--columns]}} {{1}} {{[-m|--match]}} {{string_to_match}} {{data.csv}}
-m, --matchboolean

Find rows that have a certain string in column 1

Example: csvgrep {{[-c|--columns]}} {{1}} {{[-m|--match]}} {{string_to_match}} {{data.csv}}
-r, --regexboolean

Find rows in which columns 3 or 4 match a certain `regex`

Example: csvgrep {{[-c|--columns]}} {{3,4}} {{[-r|--regex]}} {{regex}} {{data.csv}}
-i, --invert-matchboolean

Find rows in which the "name" column does NOT include the string "John Doe"

Example: csvgrep {{[-i|--invert-match]}} {{[-c|--columns]}} {{name}} {{[-m|--match]}} "{{John Doe}}" {{data.csv}}

Examples (3)

Find rows that have a certain string in column 1

csvgrep [-c|--columns] 1 [-m|--match] string_to_match data.csv

Find rows in which columns 3 or 4 match a certain `regex`

csvgrep [-c|--columns] 3,4 [-r|--regex] regex data.csv

Find rows in which the "name" column does NOT include the string "John Doe"

csvgrep [-i|--invert-match] [-c|--columns] name [-m|--match] "John Doe" data.csv
made by @shridhargupta | data from tldr-pages