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 = '2025-02-04'; # DATE
our $DIST = 'App-CSVUtils'; # DIST
our $VERSION = '1.036'; # 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.036 of csv-check-rows (from Perl distribution App-CSVUtils), released on 2025-02-04.
=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 Main options
=over
=item B<--input-skip-num-lines>=I<s>
Number of lines to skip before header row.
This can be useful if you have a CSV files (usually some generated reports,
sometimes converted from spreadsheet) that have additional header lines or info
before the CSV header row.
See also the alternative option: C<--input-skip-until-pattern>.
=item B<--input-skip-until-pattern>=I<s>
Skip rows until the first header row matches a regex pattern.
This is an alternative to the C<--input-skip-num-lines> and can be useful if you
have a CSV files (usually some generated reports, sometimes converted from
spreadsheet) that have additional header lines or info before the CSV header
row.
With C<--input-skip-num-lines>, you skip a fixed number of lines. With this
option, rows will be skipped until the first field matches the specified regex
pattern.
=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:
( run in 1.333 second using v1.01-cache-2.11-cpan-39bf76dae61 )