瀏覽代碼

added csvcut

Hayden Schiff 9 年之前
父節點
當前提交
b3710bc9a1
共有 1 個文件被更改,包括 20 次插入0 次删除
  1. 20 0
      pages/common/csvcut.md

+ 20 - 0
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}}`