App-CSVUtils
view release on metacpan or search on metacpan
script/csv-split view on Meta::CPAN
use warnings;
use Log::ger;
use Perinci::CmdLine::Any;
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2026-07-09'; # DATE
our $DIST = 'App-CSVUtils'; # DIST
our $VERSION = '1.038'; # VERSION
my $cmdline = Perinci::CmdLine::Any->new(
url => "/App/CSVUtils/csv_split/csv_split",
program_name => "csv-split",
log => 1,
read_config => 0,
read_env => 0,
use_utf8 => 1,
);
$cmdline->run;
# ABSTRACT: Split CSV file into several files
# PODNAME: csv-split
__END__
=pod
=encoding UTF-8
=head1 NAME
csv-split - Split CSV file into several files
=head1 VERSION
This document describes version 1.038 of csv-split (from Perl distribution App-CSVUtils), released on 2026-07-09.
=head1 SYNOPSIS
B<csv-split> B<L<--help|/"--help, -h, -?">> (or B<L<-h|/"--help, -h, -?">>, B<L<-?|/"--help, -h, -?">>)
B<csv-split> B<L<--version|/"--version, -v">> (or B<L<-v|/"--version, -v">>)
B<csv-split> [B<L<--debug|/"--debug">>|B<L<--log-level|/"--log-level=s">>=I<level>|B<L<--quiet|/"--quiet">>|B<L<--trace|/"--trace">>|B<L<--verbose|/"--verbose">>] [B<L<--format|/"--format=s">>=I<name>|B<L<--json|/"--json">>] [B<L<--inplace|/"--inplac...
See examples in the L</EXAMPLES> section.
=head1 DESCRIPTION
Will output split files xaa, xab, and so on. Each split file will contain a
maximum of C<lines> rows (options to limit split files' size based on number of
characters and bytes will be added). Each split file will also contain CSV
header.
Warning: by default, existing split files xaa, xab, and so on will be
overwritten.
Interface is loosely based on the C<split> Unix utility.
=head1 OPTIONS
C<*> marks required options.
=head2 Main options
=over
=item B<--lines>=I<s>, B<-l>
Default value:
1000
=back
=head2 Input options
=over
=item B<--input-escape-char>=I<s>
Specify character to escape value in field in input CSV, will be passed to Text::CSV_XS.
Defaults to C<\\> (backslash). Overrides C<--input-tsv> option.
=item B<--input-filename>=I<s>
Input CSV file.
Default value:
"-"
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
Can also be specified as the 1st command-line argument.
=item B<--input-quote-char>=I<s>
Specify field quote character in input CSV, will be passed to Text::CSV_XS.
Defaults to C<"> (double quote). Overrides C<--input-tsv> option.
=item B<--input-sep-char>=I<s>
Specify field separator character in input CSV, will be passed to Text::CSV_XS.
Defaults to C<,> (comma). Overrides C<--input-tsv> option.
=item B<--input-skip-before-num-data-rows>=I<s>
Skip a certain number of data rows for each input file.
( run in 0.600 second using v1.01-cache-2.11-cpan-64ef6c95b5d )