App-CSVUtils
view release on metacpan or search on metacpan
script/csv-check-rows view on Meta::CPAN
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_check_rows/csv_check_rows",
program_name => "csv-check-rows",
log => 1,
read_config => 0,
read_env => 0,
use_utf8 => 1,
);
$cmdline->run;
# ABSTRACT: Check CSV rows
# PODNAME: csv-check-rows
__END__
=pod
=encoding UTF-8
=head1 NAME
csv-check-rows - Check CSV rows
=head1 VERSION
This document describes version 1.038 of csv-check-rows (from Perl distribution App-CSVUtils), released on 2026-07-09.
=head1 SYNOPSIS
B<csv-check-rows> B<L<--help|/"--help, -h, -?">> (or B<L<-h|/"--help, -h, -?">>, B<L<-?|/"--help, -h, -?">>)
B<csv-check-rows> B<L<--version|/"--version, -v">> (or B<L<-v|/"--version, -v">>)
B<csv-check-rows> [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<--input-escape-...
See examples in the L</EXAMPLES> section.
=head1 DESCRIPTION
This utility performs the following checks:
For header row:
For data rows:
=over
=item * There are the same number of values as the number of fields (no missing
values, no extraneous values)
=back
For each failed check, an error message will be printed to stderr. And if there
is any error, the exit code will be non-zero. If there is no error, the utility
outputs nothing and exits with code zero.
There will be options to add some additional checks in the future.
Note that parsing errors, e.g. missing closing quotes on values, are currently
handled by L<Text::CSV_XS>.
=head1 OPTIONS
C<*> marks required options.
=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.
This option can be used to skip the first certain number of data rows. If set to
1, for example, will only process 1 data row for each input file. This option is
a convenient alternative to composing with L<csv-tail>.
( run in 1.623 second using v1.01-cache-2.11-cpan-85f18b9d64f )