CSVBREAK(1)

NAME
csvbreak - break a CSV file into multiple files based on the specified field

SYNOPSIS
csvbreak -f FIELD [OPTION]... [FILE]

DESCRIPTION
Read CSV data from standard input or FILE and break the data into multiple files based on the value of the provided FIELD. As each record is read it will be printed to a file whose name is composed of an optional prefix, the value of the specified field for that record, and an optional suffix, .csv by default. If the value of the break field contains a null character it will be truncated in the filename, any other characters in the break field will be used in the filename including characters that may be used as a directory seperator on your operating system, keep this in mind. Systems that disallow certain characters in a filename may cause csvbreak to fail if these characters are present in the break field.

-c, --print-counts
    don't create break files, just display the distinct values of the break field and the number of occurences in the file of each value

-d, --delimiter=DELIM
    Use DELIM instead of the comma character as the delimiter character

-f, --field=FIELD
    field name or number to break on. fields may be specified by number starting at 1 or by field name. A field name must contain at least one non-digit character. When using field names it is assumed that the first non-empty record contains a header with field names that match the names used in the field list, if any field names cannot be resolved from the first record an error will occur.

-h, --header
    print the header record to each file created, this option is implied when -f is provided with a field name instead of number.

-r, --remove-break-field
    do not print the break field to created files

-s, --strict
    enforce strict mode, mal-formed CSV files will cause an error

-q, --quote=QUOTE
    Use QUOTE instead of double quote as the quote character

-S, --suffix
    the suffix to use for the created files, the default is .csv

-P, --prefix
    the prefix to use for the created files

--help
    Display a help message and exit

--version
    Print version information to stderr and exit

AUTHOR
Written by Robert Gamble.

BUGS
Please send questions, comments, bugs, etc. to: rgamble@sourceforge.net

COPYRIGHT
Copyright © 2007 Robert Gamble
This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
csvcount(1), csvcheck(1), csvfix(1), csvcut(1), csvgrep(1), csvbreak(1)