.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "CSVSTACK" "1" "Jul 12, 2024" "2.0.1" "csvkit" .SH NAME csvstack \- csvstack Documentation .SH DESCRIPTION .sp Stack up the rows from multiple CSV files, optionally adding a grouping value to each row: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C usage: csvstack [\-h] [\-d DELIMITER] [\-t] [\-q QUOTECHAR] [\-u {0,1,2,3}] [\-b] [\-p ESCAPECHAR] [\-z FIELD_SIZE_LIMIT] [\-e ENCODING] [\-S] [\-H] [\-K SKIP_LINES] [\-v] [\-l] [\-\-zero] [\-V] [\-g GROUPS] [\-n GROUP_NAME] [\-\-filenames] [FILE [FILE ...]] Stack up the rows from multiple CSV files, optionally adding a grouping value. positional arguments: FILE The CSV file(s) to operate on. If omitted, will accept input as piped data via STDIN. optional arguments: \-h, \-\-help show this help message and exit \-g GROUPS, \-\-groups GROUPS A comma\-separated list of values to add as \(dqgrouping factors\(dq, one for each CSV being stacked. These are added to the output as a new column. You may specify a name for the new column using the \-n flag. \-n GROUP_NAME, \-\-group\-name GROUP_NAME A name for the grouping column, e.g. \(dqyear\(dq. Only used when also specifying \-g. \-\-filenames Use the filename of each input file as its grouping value. When specified, \-g will be ignored. .ft P .fi .UNINDENT .UNINDENT .sp See also: \fI\%Arguments common to all tools\fP\&. .sp \fBWARNING:\fP .INDENT 0.0 .INDENT 3.5 If you redirect output to an input file like \fBcsvstack file.csv > file.csv\fP, the file will grow indefinitely. .UNINDENT .UNINDENT .SH EXAMPLES .sp Join a set of files for different years: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C csvstack \-g 2009,2010 examples/realdata/FY09_EDU_Recipients_by_State.csv examples/realdata/Datagov_FY10_EDU_recp_by_State.csv .ft P .fi .UNINDENT .UNINDENT .sp Add a single column to the left of a CSV: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C csvstack \-n NEWCOL \-g \(dq\(dq examples/dummy.csv .ft P .fi .UNINDENT .UNINDENT .SH AUTHOR Christopher Groskopf and contributors .SH COPYRIGHT 2016, Christopher Groskopf and James McKinney .\" Generated by docutils manpage writer. .