Travis Build Status AppVeyor Build Status

NAME

part - split up a single input file into multiple files according to a column value

SYNOPSIS

# Split a comma separated file according to the third column
# keeping and reproducing one line of headers
perl -w part.pl example.csv --header-line=1 --column=3 "--separator=,"

# Split a tab separated file according to the second column
perl -w part.pl example.tsv --column=2 --separator=009

OPTIONS

CAVEAT

The program loads the whole input into RAM before writing the output. A future enhancement might be a uniq-like option that tells the program to assume that the input will be grouped according to the parted column so it does not need to allocate memory.

If your memory is not large enough, the following awk one-liner might help you:

# Example of parting on column 3
awk -F '{ print $0 > $3 }' FILE

REPOSITORY

The public repository of this program is https://github.com/Corion/app-part.

SUPPORT

The public support forum of this program is https://perlmonks.org/. The homepage is https://perlmonks.org/?node_id=598718 .

BUG TRACKER

Please report bugs via https://perlmonks.org.

AUTHOR

Copyright (c) 2007-2019 Max Maischein (corion@cpan.org)