view release on metacpan or search on metacpan
- Add utility: csv-transpose.
- Add cookbook (mostly only placeholders for now).
0.031 2020-08-03 Released-By: PERLANCAR; Urgency: medium
- Add CLI: csv-csv (csv2csv).
- Add CSV output options --output-{sep,quote,escape}-char for CLIs
that output CSV, e.g. csv-sort, csv-grep, csv-sum, csv-split,
csv-csv, etc.
[cli csv-info]
- [ux] Now defaults to producing naked result (RT#133078).
0.030 2020-07-30 Released-By: PERLANCAR; Urgency: medium
- Add common options: --sep-char, --quote-char, --escape-char
(RT#133079).
[cli csv-info]
- [bugfix] Avoid dying on invalid CSV by initializing $fields to []
(RT#133077).
[cli csv-setop]
- [bugfix][doc] Fix the documentation of --compare-fields (RT#133076).
lib/App/CSVUtils.pm view on Meta::CPAN
sub _instantiate_parser {
require Text::CSV_XS;
my ($args, $prefix) = @_;
$prefix //= '';
my %tcsv_opts = (binary=>1);
if (defined $args->{"${prefix}sep_char"} ||
defined $args->{"${prefix}quote_char"} ||
defined $args->{"${prefix}escape_char"}) {
$tcsv_opts{"sep_char"} = $args->{"${prefix}sep_char"} if defined $args->{"${prefix}sep_char"};
$tcsv_opts{"quote_char"} = $args->{"${prefix}quote_char"} if defined $args->{"${prefix}quote_char"};
$tcsv_opts{"escape_char"} = $args->{"${prefix}escape_char"} if defined $args->{"${prefix}escape_char"};
} elsif ($args->{"${prefix}tsv"}) {
$tcsv_opts{"sep_char"} = "\t";
$tcsv_opts{"quote_char"} = undef;
$tcsv_opts{"escape_char"} = undef;
}
$tcsv_opts{always_quote} = 1 if $args->{"${prefix}always_quote"};
$tcsv_opts{quote_empty} = 1 if $args->{"${prefix}quote_empty"};
Text::CSV_XS->new(\%tcsv_opts);
}
sub _instantiate_emitter {
my $args = shift;
_instantiate_parser($args, 'output_');
lib/App/CSVUtils.pm view on Meta::CPAN
option, rows will be skipped until the first field matches the specified regex
pattern.
MARKDOWN
},
input_tsv => {
summary => "Inform that input file is in TSV (tab-separated) format instead of CSV",
schema => 'true*',
description => <<'_',
Overriden by `--input-sep-char`, `--input-quote-char`, `--input-escape-char`
options. If one of those options is specified, then `--input-tsv` will be
ignored.
_
tags => ['category:input'],
},
input_sep_char => {
summary => 'Specify field separator character in input CSV, will be passed to Text::CSV_XS',
schema => ['str*', len=>1],
description => <<'_',
lib/App/CSVUtils.pm view on Meta::CPAN
input_quote_char => {
summary => 'Specify field quote character in input CSV, will be passed to Text::CSV_XS',
schema => ['str*', len=>1],
description => <<'_',
Defaults to `"` (double quote). Overrides `--input-tsv` option.
_
tags => ['category:input'],
},
input_escape_char => {
summary => 'Specify character to escape value in field in input CSV, will be passed to Text::CSV_XS',
schema => ['str*', len=>1],
description => <<'_',
Defaults to `\\` (backslash). Overrides `--input-tsv` option.
_
tags => ['category:input'],
},
);
lib/App/CSVUtils.pm view on Meta::CPAN
_
tags => ['category:output'],
},
output_tsv => {
summary => "Inform that output file is TSV (tab-separated) format instead of CSV",
schema => 'bool*',
description => <<'_',
This is like `--input-tsv` option but for output instead of input.
Overriden by `--output-sep-char`, `--output-quote-char`, `--output-escape-char`
options. If one of those options is specified, then `--output-tsv` will be
ignored.
_
tags => ['category:output'],
},
output_sep_char => {
summary => 'Specify field separator character in output CSV, will be passed to Text::CSV_XS',
schema => ['str*', len=>1],
description => <<'_',
lib/App/CSVUtils.pm view on Meta::CPAN
schema => ['str*', len=>1],
description => <<'_',
This is like `--input-quote-char` option but for output instead of input.
Defaults to `"` (double quote). Overrides `--output-tsv` option.
_
tags => ['category:output'],
},
output_escape_char => {
summary => 'Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS',
schema => ['str*', len=>1],
description => <<'_',
This is like `--input-escape-char` option but for output instead of input.
Defaults to `\\` (backslash). Overrides `--output-tsv` option.
_
tags => ['category:output'],
},
output_always_quote => {
summary => 'Whether to always quote values',
schema => 'bool*',
default => 0,
lib/App/CSVUtils/Manual/Cookbook.pod view on Meta::CPAN
TODO.
=head1 DEALING WITH NEWLINES IN CSV
TODO.
=head1 DEALING WITH NON-STANDARD CSV
The utilities allow you to set input's field separator (`--sep-char`), quote
character (`--quote-char`), and escape character (`--escape-char`), so if you
have semicolon as the field separator, e.g.:
name;age;rank
andi;20;staff
budi;30;manager
cinta;17;associate
and you want to sort by age:
% csv-sort-rows INPUT.CSV --sep-char ';' --by-field age
These parameters will be passed to L<Text::CSV>'s attributes with the
corresponding names.
Likewise, you can customize output's field separator (`--output-sep-char`),
quote character (`--output-quote-char`), and escape character
(`--output-escape-char`).
=head1 FILTERING FIELDS
Keywords: selecting fields, grepping fields
With L<csv-select-fields>:
% csv-select-fields 1.csv -f age -f name
age,name
25,andi
lib/App/CSVUtils/csv2paras.pm view on Meta::CPAN
use warnings;
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2025-02-04'; # DATE
our $DIST = 'App-CSVUtils'; # DIST
our $VERSION = '1.036'; # VERSION
use App::CSVUtils qw(gen_csv_util);
use String::Pad qw(pad);
sub _escape_value {
my $val = shift;
$val =~ s/(\\|\n)/$1 eq "\\" ? "\\\\" : "\\n\n "/eg;
$val;
}
sub _escape_header {
my $val = shift;
$val =~ s/(\\|\n|:)/$1 eq "\\" ? "\\\\" : $1 eq ":" ? "\\:" : "\\n\n "/eg;
$val;
}
gen_csv_util(
name => 'csv2paras',
summary => 'Convert CSV to paragraphs',
description => <<'_',
lib/App/CSVUtils/csv2paras.pm view on Meta::CPAN
notes: from work
name: jimmy
email: jimmy@example.com
phone: 555-1237
notes:
Why display in this format? It might be more visually readable or diff-able
especially if there are a lot of fields and/or there are long values.
If a CSV value contains newline, it will escaped "\n", e.g.:
# CSV
name,email,phone,notes
beth,beth@example.com,555-1231,"Has no last name
Might be adopted sometime by Jimmy"
matthew,matthew@example.com,555-1239,"Quit
or fired?"
# paragraph
name: beth
email: beth@example.com
phone: 555-1231
notes: Has no last name\nMight be adopted sometime by Jimmy
name: matthew
email: matthew@example.com
phone: 555-1239
notes: Quit\n\n or fired?
If a CSV value contains literal "\" (backslash) it will be escaped as "\\".
Long lines are also by default folded at 78 columns (but you can customize with
the `--width` option); if a line is folded a literal backslash is added to the
end of each physical line and the next line will be indented by two spaces:
notes: This is a long note. This is a long note. This is a long note. This is
a long note. This is a long note.
A long word is also folded and the next line will be indented by one space:
notes: Thisisalongwordthisisalongwordthisisalongwordthisisalongwordthisisalongw
ord
Newline and backslash are also escaped in header; additionally a literal ":"
(colon) is escaped into "\:".
There is option to skip displaying empty fields (`--hide-empty-values`) and to
align the ":" header separator.
Keywords: paragraphs, cards, pages, headers
_
add_args => {
width => {
summary => 'The width at which to fold long lines, -1 means to never fold',
lib/App/CSVUtils/csv2paras.pm view on Meta::CPAN
src_plang => 'bash',
test => 0,
'x.doc.show_result' => 0,
},
],
on_input_header_row => sub {
my $r = shift;
# these are the keys we add to the stash
$r->{escaped_headers} = [];
$r->{longest_header_len} = 0;
for my $field (@{ $r->{input_fields} }) {
push @{ $r->{escaped_headers} }, _escape_header($field);
my $l = length($r->{escaped_headers}[-1]);
$r->{longest_header_len} = $l if $r->{longest_header_len} < $l;
}
},
on_input_data_row => sub {
my $r = shift;
print "\n" if $r->{input_data_rownum} > 1;
for my $i (0 .. $#{ $r->{input_fields} }) {
my $val = $r->{input_row}[$i];
next if $r->{util_args}{hide_empty_values} && length $val == 0;
my $line =
($r->{util_args}{align} ? pad($r->{escaped_headers}[$i], $r->{longest_header_len}, "r") : $r->{escaped_headers}[$i]).
": ".
_escape_value($val);
if ($r->{util_args}{width} == -1 || length($line) <= $r->{util_args}{width}) {
print $line, "\n";
} else {
require Text::Wrap::NoStrip;
local $Text::Wrap::NoStrip::columns = $r->{util_args}{width};
my $wrapped_line = Text::Wrap::NoStrip::wrap("", " ", $line);
print $wrapped_line, "\n";
}
}
},
lib/App/CSVUtils/csv2paras.pm view on Meta::CPAN
notes: from work
name: jimmy
email: jimmy@example.com
phone: 555-1237
notes:
Why display in this format? It might be more visually readable or diff-able
especially if there are a lot of fields and/or there are long values.
If a CSV value contains newline, it will escaped "\n", e.g.:
# CSV
name,email,phone,notes
beth,beth@example.com,555-1231,"Has no last name
Might be adopted sometime by Jimmy"
matthew,matthew@example.com,555-1239,"Quit
or fired?"
# paragraph
name: beth
email: beth@example.com
phone: 555-1231
notes: Has no last name\nMight be adopted sometime by Jimmy
name: matthew
email: matthew@example.com
phone: 555-1239
notes: Quit\n\n or fired?
If a CSV value contains literal "\" (backslash) it will be escaped as "\".
Long lines are also by default folded at 78 columns (but you can customize with
the C<--width> option); if a line is folded a literal backslash is added to the
end of each physical line and the next line will be indented by two spaces:
notes: This is a long note. This is a long note. This is a long note. This is
a long note. This is a long note.
A long word is also folded and the next line will be indented by one space:
notes: Thisisalongwordthisisalongwordthisisalongwordthisisalongwordthisisalongw
ord
Newline and backslash are also escaped in header; additionally a literal ":"
(colon) is escaped into "\:".
There is option to skip displaying empty fields (C<--hide-empty-values>) and to
align the ":" header separator.
Keywords: paragraphs, cards, pages, headers
This function is not exported.
Arguments ('*' denotes required arguments):
lib/App/CSVUtils/csv2paras.pm view on Meta::CPAN
Whether to align header separator across lines.
Note that if you want to convert the paragraphs back to CSV later using
L<paras2csv>, the padding spaces added by this option will become part of
header value, unless you use its C<--trim-header> or C<--rtrim-header> option.
=item * B<hide_empty_values> => I<bool>
Whether to skip showing empty values.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv2paras.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<width> => I<int> (default: 78)
The width at which to fold long lines, -1 means to never fold.
=back
lib/App/CSVUtils/csv2td.pm view on Meta::CPAN
Read more about "table data" in L<App::td>, which comes with a CLI L<td>
to munge table data.
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv2td.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
lib/App/CSVUtils/csv2vcf.pm view on Meta::CPAN
=over 4
=item * B<cell_vcf_field> => I<str>
Select field to use as VCF CELL field.
=item * B<email_vcf_field> => I<str>
Select field to use as VCF EMAIL field.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv2vcf.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<name_vcf_field> => I<str>
Select field to use as VCF N (name) field.
=back
lib/App/CSVUtils/csv_add_fields.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_add_fields.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_add_fields.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=back
lib/App/CSVUtils/csv_avg.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_avg.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_avg.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=item * B<with_data_rows> => I<bool>
Whether to also output data rows.
lib/App/CSVUtils/csv_check_cell_values.pm view on Meta::CPAN
When unknown fields are specified in --include-field (--field) or --exclude-field options, ignore them instead of throwing an error.
=item * B<include_field_pat> => I<re>
Field regex pattern to select, overidden by --exclude-field-pat.
=item * B<include_fields> => I<array[str]>
Field names to include, takes precedence over --exclude-field-pat.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_check_cell_values.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<print_validated> => I<bool>
Print the validated values of each cell.
When validating with schema, will print each validated (possible coerced,
filtered) value of each cell.
lib/App/CSVUtils/csv_check_field_names.pm view on Meta::CPAN
=back
There will be options to add some additional checks in the future.
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_check_field_names.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
lib/App/CSVUtils/csv_check_field_values.pm view on Meta::CPAN
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<field>* => I<str>
Field name.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_check_field_values.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<quiet> => I<bool>
(No description)
=item * B<with_code> => I<str|code>
Check with Perl code.
lib/App/CSVUtils/csv_check_rows.pm view on Meta::CPAN
Note that parsing errors, e.g. missing closing quotes on values, are currently
handled by L<Text::CSV_XS>.
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_check_rows.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
lib/App/CSVUtils/csv_cmp.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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_filenames> => I<array[filename]> (default: ["-"])
Input CSV files.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_cmp.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_cmp.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=item * B<quiet> => I<true>
Do not report, just signal via exit code.
lib/App/CSVUtils/csv_concat.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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_filenames> => I<array[filename]> (default: ["-"])
Input CSV files.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_concat.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_concat.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overlay> => I<bool>
Whether to overlay rows from second and subsequent CSV files to the first.
By default, rows from the second CSV file will be added after all the rows from
the first CSV are added, and so on. However, when this option is enabled, the
rows the second and subsequent CSV files will be added together (overlaid). See
lib/App/CSVUtils/csv_convert_to_hash.pm view on Meta::CPAN
csv_convert_to_hash(input_filename => "file.csv", rownum => 2);
=back
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_convert_to_hash.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<rownum> => I<posint> (default: 1)
Row number (e.g. 1 for first data row).
=back
lib/App/CSVUtils/csv_csv.pm view on Meta::CPAN
use App::CSVUtils qw(
gen_csv_util
);
gen_csv_util(
name => 'csv_csv',
summary => 'Convert CSV to CSV',
description => <<'_',
Why convert CSV to CSV? When you want to change separator/quote/escape
character, for one. Or you want to remove header or add one.
Example:
# in.csv
name,age
andi,12
budi,13
% csv-csv in.csv --output-sep-char ';'
lib/App/CSVUtils/csv_csv.pm view on Meta::CPAN
=head2 csv_csv
Usage:
csv_csv(%args) -> [$status_code, $reason, $payload, \%result_meta]
Convert CSV to CSV.
Why convert CSV to CSV? When you want to change separator/quote/escape
character, for one. Or you want to remove header or add one.
Example:
# in.csv
name,age
andi,12
budi,13
% csv-csv in.csv --output-sep-char ';'
lib/App/CSVUtils/csv_csv.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_csv.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_csv.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=back
lib/App/CSVUtils/csv_delete_fields.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_delete_fields.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_delete_fields.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=item * B<show_selected_fields> => I<true>
Show selected fields and then immediately exit.
lib/App/CSVUtils/csv_dump.pm view on Meta::CPAN
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<hash> => I<true>
Dump CSV as array of hashrefs instead of array of arrayrefs.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_dump.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
lib/App/CSVUtils/csv_each_row.pm view on Meta::CPAN
=over 4
=item * B<eval>* => I<str|code>
Perl code.
=item * B<hash> => I<bool>
Provide row in $_ as hashref instead of arrayref.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_each_row.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
lib/App/CSVUtils/csv_fill_cells.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_fill_cells.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<layout> => I<str> (default: "left_to_right_then_top_to_bottom")
Specify how the output CSV is to be filled.
=item * B<num_fields>* => I<posint>
Number of fields of the output CSV.
lib/App/CSVUtils/csv_fill_cells.pm view on Meta::CPAN
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_fill_cells.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=back
lib/App/CSVUtils/csv_fill_template.pm view on Meta::CPAN
instead. I was relieved, the pelican was a friendly creature after all.
After we slept for a little while, I went home with a(n) desk on my
face. That was an unforgettable day indeed.
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_fill_template.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<template_filename>* => I<filename>
(No description)
=back
lib/App/CSVUtils/csv_find_values.pm view on Meta::CPAN
Field name.
=item * B<fuzzy> => I<true>
(No description)
=item * B<ignore_case> => I<bool>
(No description)
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_find_values.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<print_when> => I<str> (default: "found")
Overriden by the C<--eval> option.
=item * B<values>* => I<array[str]>
(No description)
lib/App/CSVUtils/csv_freqtable.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_freqtable.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<key> => I<str|code>
Generate computed field with this Perl code.
If specified, then will compute field using Perl code.
The code will receive the row (arrayref, or if -H is specified, hashref) as the
lib/App/CSVUtils/csv_freqtable.pm view on Meta::CPAN
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_freqtable.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=item * B<with_data_rows> => I<bool>
Whether to also output data rows.
lib/App/CSVUtils/csv_gen.pm view on Meta::CPAN
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_gen.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=back
lib/App/CSVUtils/csv_get_cells.pm view on Meta::CPAN
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<coordinates>* => I<array[str]>
List of coordinates, each in the form of <colE<gt>,<rowE<gt> e.g. age,1 or 1,1.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_get_cells.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
lib/App/CSVUtils/csv_grep.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_grep.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_grep.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=back
lib/App/CSVUtils/csv_info.pm view on Meta::CPAN
csv_info(input_filename => "file.csv");
=back
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_info.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
lib/App/CSVUtils/csv_intrange.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_intrange.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_intrange.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=item * B<sort> => I<true>
Sort the values first.
lib/App/CSVUtils/csv_list_field_names.pm view on Meta::CPAN
csv_list_field_names(input_filename => "file.csv");
=back
This function is not exported.
Arguments ('*' denotes required arguments):
=over 4
=item * B<input_escape_char> => I<str>
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<filename> (default: "-")
Input CSV file.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_list_field_names.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=back
Returns an enveloped result (an array).
First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
lib/App/CSVUtils/csv_lookup_fields.pm view on Meta::CPAN
=back
=item * B<inplace_backup_ext> => I<str> (default: "")
Extension to add for backup of input file.
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
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_filenames> => I<array[filename]> (default: ["-"])
Input CSV files.
Use C<-> to read from stdin.
Encoding of input file is assumed to be UTF-8.
lib/App/CSVUtils/csv_lookup_fields.pm view on Meta::CPAN
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.
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<lookup_fields>* => I<str>
(No description)
=item * B<output_always_quote> => I<bool> (default: 0)
Whether to always quote values.
When set to false (the default), values are quoted only when necessary:
field1,field2,"field three contains comma (,)",field4
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
Output filename.
Use C<-> to output to stdout (the default if you don't specify this option).
Encoding of output file is assumed to be UTF-8.
lib/App/CSVUtils/csv_lookup_fields.pm view on Meta::CPAN
This is like C<--input-sep-char> option but for output instead of input.
Defaults to C<,> (comma). Overrides C<--output-tsv> option.
=item * B<output_tsv> => I<bool>
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
Whether to override existing output file.
=back