mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-19 18:50:23 +00:00
Update cheatsheets
This commit is contained in:
26
csvcut
Normal file
26
csvcut
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# csvcut
|
||||
|
||||
> Filter and truncate CSV files. Like Unix's `cut` command, but for tabular data.
|
||||
> Included in csvkit.
|
||||
> More information: <https://csvkit.readthedocs.io/en/latest/scripts/csvcut.html>.
|
||||
|
||||
- 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}}`
|
||||
Reference in New Issue
Block a user