-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcsv-split.1
More file actions
28 lines (28 loc) · 1.69 KB
/
csv-split.1
File metadata and controls
28 lines (28 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.\" Manpage for csv-split.
.\" Send bugs to mike.grunder@performancehorizon.com, or just yell at me.
.TH man 1 "29 Jan 2013" "1.0" "csv-split"
.SH NAME
csv-split \- Process a CSV file and split it into parts
.SH SYNOPSIS
csv-split [OPTIONS] FILE OUTPUT-PATH
.SH DESCRIPTION
csv-split will process a csv file on the filesystem or read one from STDIN and break it into multiple parts, as specified by options.
.SH OPTIONS
.TP
\fB-g\fR, \fB\-\-group-col\fR
The zero based column with values that must remain together. If specified, csv-split will not seperate rows with the same value in this column apart. This assumes that the file is sorted by this column, however.
.TP
\fB-n\fR, \fB\-\-num-rows\fR
The maximum number of rows to put in each file. If we're grouping column values, the actual number of rows can be slightly more than this.
.TP
\fB\-\-stdin\fR
If provided, csv-split will read from standard input, rather than trying to open a file
.TP
\fB-z\fR, \fB\-\-gzip\fR
If this argument is present, each file will be gzip compressed when written
.TP
\fB-t\fR, \fB\-\-trigger\fR
Each time \fBcsv-split\fR writes a chunk of data, it can be configured to run a command specified by this option. Two environment variables will be set prior to running the command. CSV_PAYLOAD_FILE will contain the file that was written, and CSV_PAYLOAD_ROWCOUNT will contain the number of lines in the split file.
.TP
\fB-d\fR, \fB\-\-header\fR
If you pass this argument, csv-split will treat the first row as a header and inject it into each split file. By default this header row is not counted toward the total row count in each file. To count the header row toward each total, pass 1 as an option to the argument (e.g. --header=1, -d1).