App-CSVUtils
view release on metacpan or search on metacpan
script/csv-check-field-values 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_field_values/csv_check_field_values",
program_name => "csv-check-field-values",
log => 1,
read_config => 0,
read_env => 0,
use_utf8 => 1,
);
$cmdline->run;
# ABSTRACT: Check the values of whole fields against code/schema
# PODNAME: csv-check-field-values
__END__
=pod
=encoding UTF-8
=head1 NAME
csv-check-field-values - Check the values of whole fields against code/schema
=head1 VERSION
This document describes version 1.038 of csv-check-field-values (from Perl distribution App-CSVUtils), released on 2026-07-09.
=head1 SYNOPSIS
B<csv-check-field-values> B<L<--help|/"--help, -h, -?">> (or B<L<-h|/"--help, -h, -?">>, B<L<-?|/"--help, -h, -?">>)
B<csv-check-field-values> B<L<--version|/"--version, -v">> (or B<L<-v|/"--version, -v">>)
B<csv-check-field-values> [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...
=head1 DESCRIPTION
Example C<input.csv>:
ingredient,%weight
foo,81
bar,9
baz,10
Example C<input2.csv>:
ingredient,%weight
foo,81
bar,9
baz,10
Check that ingredients are sorted in descending %weight:
% csv-check-field-values input.csv %weight --with-schema array::num::rev_sorted
ERROR 400: Field '%weight' does not validate with schema 'array::num::rev_sorted'
% csv-check-field-values input2.csv %weight --with-schema array::num::rev_sorted
Field '%weight' validates with schema 'array::num::rev_sorted'
=head1 OPTIONS
C<*> marks required options.
=head2 Main options
=over
=item B<--field>=I<s>*, B<-f>
Field name.
Can also be specified as the 2nd command-line argument.
=item B<--quiet-arg>, B<-q>
(No description)
=item B<--with-code-json>=I<s>
Check with Perl code (JSON-encoded).
See C<--with-code>.
=item B<--with-code>=I<s>
Check with Perl code.
Code will be given the value of the rows of the field as an array of scalars and
should return a true value if value is valid.
=item B<--with-schema-json>=I<s>
Check with a Sah schema module (JSON-encoded).
See C<--with-schema>.
=item B<--with-schema>=I<s>
Check with a Sah schema module.
Should be the name of a Sah schema module without the C<Sah::Schema::> prefix,
typically in the C<Sah::Schema::array::> subnamespace.
=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.
( run in 0.977 second using v1.01-cache-2.11-cpan-81fc1098f69 )