csvcut
CSV column selector and reorderer
TLDR
Select specific columns
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.
