From 588482fc786707a73408dea06e285329b89296b5 Mon Sep 17 00:00:00 2001 From: Hayden Schiff Date: Thu, 21 Jan 2016 18:03:29 -0500 Subject: [PATCH] added csvgrep --- pages/common/csvgrep.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pages/common/csvgrep.md diff --git a/pages/common/csvgrep.md b/pages/common/csvgrep.md new file mode 100644 index 000000000..a5723729a --- /dev/null +++ b/pages/common/csvgrep.md @@ -0,0 +1,16 @@ +# csvgrep + +> Filter CSV rows with string and pattern matching. +> Included in csvkit. + +- Find rows that have a certain string in column 1: + +`csvgrep -c {{1}} -m {{string_to_match}} {{data.csv}}` + +- Find rows in which columns 3 or 4 matches a certain regex pattern: + +`csvgrep -c {{3,4}} -r {{regex_pattern}} {{data.csv}}` + +- Find rows in which the "name" column does NOT include the string "John Doe": + +`csvgrep -i -c {{name}} -m {{"John Doe"}} {{data.csv}}`