HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

xsv — A CSV toolkit written in Rust. More information: <https://github.com/BurntSushi/xsv>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
toolkitcommandrustwrittenclimorexsvcsv

Problem

How to use the xsv command: A CSV toolkit written in Rust. More information: <https://github.com/BurntSushi/xsv>.

Solution

xsv — A CSV toolkit written in Rust. More information: <https://github.com/BurntSushi/xsv>.

Inspect the headers of a file:
xsv headers {{path/to/file.csv}}


Count the number of entries:
xsv count {{path/to/file.csv}}


Get an overview of the shape of entries:
xsv stats {{path/to/file.csv}} | xsv table


Select a few columns:
xsv select {{column1,column2}} {{path/to/file.csv}}


Show 10 random entries:
xsv sample {{10}} {{path/to/file.csv}}


Join a column from one file to another:
xsv join --no-case {{column1}} {{path/to/file1.csv}} {{column2}} {{path/to/file2.csv}} | xsv table

Code Snippets

Inspect the headers of a file

xsv headers {{path/to/file.csv}}

Count the number of entries

xsv count {{path/to/file.csv}}

Get an overview of the shape of entries

xsv stats {{path/to/file.csv}} | xsv table

Select a few columns

xsv select {{column1,column2}} {{path/to/file.csv}}

Show 10 random entries

xsv sample {{10}} {{path/to/file.csv}}

Context

tldr-pages: common/xsv

Revisions (0)

No revisions yet.