From b3710bc9a1557b57883fe4e67b611d769bee694a Mon Sep 17 00:00:00 2001 From: Hayden Schiff Date: Thu, 21 Jan 2016 18:02:55 -0500 Subject: [PATCH] added csvcut --- pages/common/csvcut.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/common/csvcut.md diff --git a/pages/common/csvcut.md b/pages/common/csvcut.md new file mode 100644 index 000000000..f74ecf5ad --- /dev/null +++ b/pages/common/csvcut.md @@ -0,0 +1,20 @@ +# csvcut + +> Filter and truncate CSV files. Like unix "cut" command, but for tabular data. +> Included in csvkit. + +- Print indices and names of all columns: + +`csvcut -n {{data.csv}}` + +- Extract the first and third columns: + +`csvcut -c {{1,3}} {{data.csv}}` + +- Extract all columns EXCEPT the fourth one: + +`csvcut -C {{4}} {{data.csv}}` + +- Extract the columns named "id" and "first name" (in that order): + +`csvcut -c {{id,"first name"}} {{data.csv}}`