LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

csvstack

Vertically concatenate CSV files

TLDR

Stack multiple CSV files
$ csvstack [file1.csv] [file2.csv] > [combined.csv]
copy
Stack with a grouping column to identify source files
$ csvstack -g [source1,source2] [file1.csv] [file2.csv]
copy
Name the grouping column
$ csvstack -g [a,b] -n [source] [file1.csv] [file2.csv]
copy
Stack using filenames as group values automatically
$ csvstack --filenames [file1.csv] [file2.csv]
copy
Stack files that have no header row
$ csvstack -H [file1.csv] [file2.csv]
copy
Stack semicolon-delimited files
$ csvstack -d ";" [file1.csv] [file2.csv]
copy

SYNOPSIS

csvstack [options] files...

DESCRIPTION

csvstack concatenates multiple CSV files vertically (row-wise). Part of csvkit, it aligns columns by header name and can add a grouping column to track source files.The tool handles files with different column orders by matching header names, making it robust for combining datasets from different sources.

PARAMETERS

-g names

Add grouping column with values.
-n name
Name for grouping column.
-H, --no-header-row
Inputs have no header row.
--filenames
Use filenames as group values.
-d char
Field delimiter.
-q char
Quote character.
-e encoding
Input encoding.

CAVEATS

All files should have matching columns for clean output. Missing columns filled with empty values. Part of csvkit, requires Python. Headers from first file used if different.

HISTORY

csvstack is part of csvkit, created by Christopher Groskopf in 2011. It simplifies combining multiple data files, a common task in data processing and analysis workflows.

SEE ALSO

csvcut(1), csvlook(1), csvjoin(1), csvgrep(1), csvstat(1)

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