LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

csvcut

CSV column selector and reorderer

TLDR

Select specific columns
$ csvcut -c [1,3,5] [data.csv]
copy
Select columns by name
$ csvcut -c [name,email] [data.csv]
copy
Exclude columns
$ csvcut -C [column] [data.csv]
copy
Use different delimiter
$ csvcut -d ";" -c [1,2] [data.csv]
copy
Select column range
$ csvcut -c [1-5] [data.csv]
copy
Read from stdin
$ cat [data.csv] | csvcut -c [name]
copy

SYNOPSIS

csvcut [options] file

DESCRIPTION

csvcut is part of csvkit, a suite of CSV processing utilities. It selects and reorders columns from CSV files, similar to cut but with proper CSV handling including quoted fields.The tool correctly handles CSV edge cases like embedded commas and newlines within quoted fields, making it more reliable than text-based alternatives for structured data.

PARAMETERS

-c columns

Columns to select (names or indices).
-C columns
Columns to exclude.
-d char
Field delimiter character.
-t char
Tab delimiter shortcut.
-q char
Quote character.
-e encoding
Input file encoding.
-n
Display column names and indices.
-l
Insert line numbers column.
--no-header-row
Input has no header row.

CAVEATS

Part of csvkit, requires Python. Column indices are 1-based. Large files may be slow compared to native tools. Memory usage scales with file size.

HISTORY

csvcut is part of csvkit, created by Christopher Groskopf in 2011. The toolkit was developed to provide reliable CSV handling for data journalism and analysis, addressing shortcomings of traditional Unix text tools with structured data.

SEE ALSO

csvlook(1), csvstat(1), cut(1), awk(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid