csvtool
Fast CSV manipulation utility
TLDR
Extract specific columns from a CSV
SYNOPSIS
csvtool [options] command [arguments] file
DESCRIPTION
csvtool is a fast CSV manipulation utility written in OCaml. It provides various operations for transforming, filtering, and analyzing CSV data from the command line.
The tool is designed for speed and handles large files efficiently. It supports common operations like column extraction, row filtering, transposition, and file joining. The call command enables running external commands for each row.
csvtool uses a streaming approach where possible, allowing it to process files larger than available memory for many operations. It properly handles CSV quoting and escaping.
PARAMETERS
col COLUMNS
Extract specified columns (1-indexed, comma-separated).head N
Output first N rows.drop N
Drop first N rows.transpose
Transpose rows and columns.paste
Paste files side by side.replace COL OLD NEW
Replace values in a column.join COL
Join files on a column.call COMMAND
Run command for each row.-t CHAR
Input delimiter (default: comma).-u CHAR
Output delimiter.-o FILE
Output file.
CAVEATS
Column numbers are 1-indexed, not 0-indexed. Some operations require loading the entire file into memory. Quoting rules may differ from other CSV tools. Error messages can be cryptic.
HISTORY
csvtool was developed as a fast, lightweight CSV processor. Written in OCaml for performance, it provides an alternative to heavier tools when simple, fast transformations are needed on CSV data.
