view release on metacpan or search on metacpan
and value the argument specification as defined in Rinci::function)).
Some argument specifications have been defined in App::CSVUtils and can
be used. See existing utilities for examples.
*READING CSV DATA*
To read CSV data, normally your utility would provide handler for the
"on_input_data_row" hook and sometimes additionally
"on_input_header_row".
*OUTPUTTING STRING OR RETURNING RESULT*
To output string, usually you call the provided routine
"$r->{code_print}". This routine will open the output files for you.
You can also return enveloped result directly by setting "$r->{result}".
*OUTPUTTING CSV DATA*
To output CSV data, usually you call the provided routine
"$r->{code_print_row}". This routine accepts a row (arrayref or
hashref). This routine will open the output files for you when needed,
as well as print header row automatically.
You can also buffer rows from input to e.g. "$r->{output_rows}", then
call "$r->{code_print_row}" repeatedly in the "after_read_input" hook to
print all the rows.
*WRITING TO MULTIPLE CSV FILES*
Similarly, to write to many CSv files, you first specify
"writes_multiple_csv". Then, you can supply handler for
"on_input_header_row" and "on_input_data_row" as usual. To switch to the
next file, set "$r->{wants_switch_to_next_output_file}" to true, in
which case the next call to "$r->{code_print_row}" will close the
current file and open the next file.
*CHANGING THE OUTPUT FIELDS*
When calling "$r->{code_print_row}", you can output whatever fields you
want. By convention, you can set "$r->{output_fields}" and
"$r->{output_fields_idx}" to let other handlers know about the output
fields. For example, see the implementation of csv-concat.
This function is not exported by default, but exportable.
Arguments ('*' denotes required arguments):
lib/App/CSVUtils.pm view on Meta::CPAN
},
);
our %argspecsopt_inplace = (
inplace => {
summary => 'Output to the same file as input',
schema => 'true*',
description => <<'_',
Normally, you output to a different file than input. If you try to output to the
same file (`-o INPUT.csv -O`) you will clobber the input file; thus the utility
prevents you from doing it. However, with this `--inplace` option, you can
output to the same file. Like perl's `-i` option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (`-o`) when using this option,
but you can specify backup extension with `-b` option.
Some caveats:
- if input file is a symbolic link, it will be replaced with a regular file;
- renaming (implemented using `rename()`) can fail if input filename is too long;
lib/App/CSVUtils.pm view on Meta::CPAN
specifications have been defined in <pm:App::CSVUtils> and can be used. See
existing utilities for examples.
*READING CSV DATA*
To read CSV data, normally your utility would provide handler for the
`on_input_data_row` hook and sometimes additionally `on_input_header_row`.
*OUTPUTTING STRING OR RETURNING RESULT*
To output string, usually you call the provided routine `$r->{code_print}`. This
routine will open the output files for you.
You can also return enveloped result directly by setting `$r->{result}`.
*OUTPUTTING CSV DATA*
To output CSV data, usually you call the provided routine `$r->{code_print_row}`.
This routine accepts a row (arrayref or hashref). This routine will open the
output files for you when needed, as well as print header row automatically.
You can also buffer rows from input to e.g. `$r->{output_rows}`, then call
`$r->{code_print_row}` repeatedly in the `after_read_input` hook to print all the
rows.
lib/App/CSVUtils.pm view on Meta::CPAN
*WRITING TO MULTIPLE CSV FILES*
Similarly, to write to many CSv files, you first specify `writes_multiple_csv`.
Then, you can supply handler for `on_input_header_row` and `on_input_data_row`
as usual. To switch to the next file, set
`$r->{wants_switch_to_next_output_file}` to true, in which case the next call to
`$r->{code_print_row}` will close the current file and open the next file.
*CHANGING THE OUTPUT FIELDS*
When calling `$r->{code_print_row}`, you can output whatever fields you want. By
convention, you can set `$r->{output_fields}` and `$r->{output_fields_idx}` to
let other handlers know about the output fields. For example, see the
implementation of <prog:csv-concat>.
_
args => {
name => {
schema => 'perl::identifier::unqualified_ascii*',
lib/App/CSVUtils.pm view on Meta::CPAN
last unless -e $output_filename;
}
push @output_filenames, $output_filename;
}
} elsif ($writes_multiple_csv) {
@output_filenames = @{ $util_args{output_filenames} // ['-'] };
} else {
@output_filenames = ($util_args{output_filename} // '-');
}
CHECK_OUTPUT_FILENAME_SAME_AS_INPUT_FILENAME: {
my %seen_output_abs_path; # key = output filename
last unless $reads_csv && $writes_csv;
for my $input_filename (@{ $r->{input_filenames} }) {
next if $input_filename eq '-';
my $input_abs_path = Cwd::abs_path($input_filename);
die [500, "Can't get absolute path of input filename '$input_filename'"] unless $input_abs_path;
for my $output_filename (@output_filenames) {
next if $output_filename eq '-';
next if $seen_output_abs_path{$output_filename};
my $output_abs_path = Cwd::abs_path($output_filename);
die [500, "Can't get absolute path of output filename '$output_filename'"] unless $output_abs_path;
die [412, "Cannot set output filename to '$output_filename' ".
($output_filename ne $output_abs_path ? "($output_abs_path) ":"").
"because it is the same as input filename and input will be clobbered; use --inplace to avoid clobbering<"]
if $output_abs_path eq $input_abs_path;
}
}
} # CHECK_OUTPUT_FILENAME_SAME_AS_INPUT_FILENAME
$r->{output_filenames} = \@output_filenames;
$r->{output_num_of_files} //= scalar(@output_filenames);
} # set output filenames
# open the next file, if not yet
if (!$r->{output_fh} || $r->{wants_switch_to_next_output_file}) {
$r->{output_filenum} //= 0;
$r->{output_filenum}++;
lib/App/CSVUtils.pm view on Meta::CPAN
$r->{input_parser} = $input_parser;
my @input_filenames;
if ($reads_multiple_csv) {
@input_filenames = @{ $util_args{input_filenames} // ['-'] };
} else {
@input_filenames = ($util_args{input_filename} // '-');
}
$r->{input_filenames} //= \@input_filenames;
BEFORE_INPUT_FILENAME:
$r->{input_filenum} = 0;
INPUT_FILENAME:
for my $input_filename (@input_filenames) {
$r->{input_filenum}++;
$r->{input_filename} = $input_filename;
$r->{input_file_input_has_been_skipped} = 0;
if ($r->{input_filenum} == 1 && $before_open_input_files) {
log_trace "[csvutil] Calling before_open_input_files handler ...";
$before_open_input_files->($r);
if (delete $r->{wants_skip_files}) {
log_trace "[csvutil] Handler wants to skip files, skipping all input files";
last READ_CSV;
}
}
if ($before_open_input_file) {
log_trace "[csvutil] Calling before_open_input_file handler ...";
$before_open_input_file->($r);
if (delete $r->{wants_skip_file}) {
log_trace "[csvutil] Handler wants to skip this file, moving on to the next file";
next INPUT_FILENAME;
} elsif (delete $r->{wants_skip_files}) {
log_trace "[csvutil] Handler wants to skip all files, skipping all input files";
last READ_CSV;
}
}
log_info "[csvutil] [file %d/%d] Reading input file %s ...",
$r->{input_filenum}, scalar(@input_filenames), $input_filename;
my ($fh, $err) = _open_file_read($input_filename);
die $err if $err;
lib/App/CSVUtils.pm view on Meta::CPAN
for my $j (0 .. $#{ $r->{input_fields} }) {
$r->{input_fields_idx}{ $r->{input_fields}[$j] } = $j;
}
if ($on_input_header_row) {
log_trace "[csvutil] Calling on_input_header_row hook handler ...";
$on_input_header_row->($r);
if (delete $r->{wants_skip_file}) {
log_trace "[csvutil] Handler wants to skip this file, moving on to the next file";
next INPUT_FILENAME;
} elsif (delete $r->{wants_skip_files}) {
log_trace "[csvutil] Handler wants to skip all files, skipping all input files";
last READ_CSV;
}
}
# reindex the fields, should the above hook
# handler adds/removes fields. let's save the
# old fields_idx to orig_fields_idx.
$r->{orig_input_fields_idx} = $r->{input_fields_idx};
lib/App/CSVUtils.pm view on Meta::CPAN
$r->{input_row_as_hashref}{ $r->{input_fields}[$j] } = $r->{input_row}[$j];
}
}
if ($on_input_data_row) {
log_trace "[csvutil] Calling on_input_data_row hook handler (for first data row) ..." if $r->{input_rownum} <= 2;
$on_input_data_row->($r);
if (delete $r->{wants_skip_file}) {
log_trace "[csvutil] Handler wants to skip this file, moving on to the next file";
next INPUT_FILENAME;
} elsif (delete $r->{wants_skip_files}) {
log_trace "[csvutil] Handler wants to skip all files, skipping all input files";
last READ_CSV;
}
}
}
} # while getline
# XXX actually close filehandle except stdin
lib/App/CSVUtils.pm view on Meta::CPAN
first via C<add_args> (as hashref, with key being argument name and value the
argument specification as defined in L<Rinci::function>)). Some argument
specifications have been defined in L<App::CSVUtils> and can be used. See
existing utilities for examples.
I<READING CSV DATA>
To read CSV data, normally your utility would provide handler for the
C<on_input_data_row> hook and sometimes additionally C<on_input_header_row>.
I<OUTPUTTING STRING OR RETURNING RESULT>
To output string, usually you call the provided routine C<< $r-E<gt>{code_print} >>. This
routine will open the output files for you.
You can also return enveloped result directly by setting C<< $r-E<gt>{result} >>.
I<OUTPUTTING CSV DATA>
To output CSV data, usually you call the provided routine C<< $r-E<gt>{code_print_row} >>.
This routine accepts a row (arrayref or hashref). This routine will open the
output files for you when needed, as well as print header row automatically.
You can also buffer rows from input to e.g. C<< $r-E<gt>{output_rows} >>, then call
C<< $r-E<gt>{code_print_row} >> repeatedly in the C<after_read_input> hook to print all the
rows.
I<READING MULTIPLE CSV FILES>
lib/App/CSVUtils.pm view on Meta::CPAN
handler for C<before_open_input_file> or C<after_close_input_file>.
I<WRITING TO MULTIPLE CSV FILES>
Similarly, to write to many CSv files, you first specify C<writes_multiple_csv>.
Then, you can supply handler for C<on_input_header_row> and C<on_input_data_row>
as usual. To switch to the next file, set
C<< $r-E<gt>{wants_switch_to_next_output_file} >> to true, in which case the next call to
C<< $r-E<gt>{code_print_row} >> will close the current file and open the next file.
I<CHANGING THE OUTPUT FIELDS>
When calling C<< $r-E<gt>{code_print_row} >>, you can output whatever fields you want. By
convention, you can set C<< $r-E<gt>{output_fields} >> and C<< $r-E<gt>{output_fields_idx} >> to
let other handlers know about the output fields. For example, see the
implementation of L<csv-concat>.
This function is not exported by default, but exportable.
Arguments ('*' denotes required arguments):
lib/App/CSVUtils/Manual/Cookbook.pod view on Meta::CPAN
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
lib/App/CSVUtils/Manual/Cookbook.pod view on Meta::CPAN
budi,30
cinta,17
becomes:
name,andi,budi,cinta
age,20,30,17
To do this:
% csv-transpose INPUT.CSV
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/App-CSVUtils>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-App-CSVUtils>.
=head1 SEE ALSO
lib/App/CSVUtils/csv2paras.pm view on Meta::CPAN
},
},
links => [
{url=>'prog:paras2csv'},
],
tags => ['category:converting'],
examples => [
{
summary => 'Convert to paragraphs format, show fields alphabetically, do not fold, hide empty values',
src => 'csv-sort-fields INPUT.csv | [[prog]] --width=-1 --hide-empty-values',
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
lib/App/CSVUtils/csv_add_fields.pm view on Meta::CPAN
=item * B<hash> => I<bool>
Provide row in $_ as hashref instead of arrayref.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_avg.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_cmp.pm view on Meta::CPAN
=item * B<include_fields> => I<array[str]>
Field names to include, takes precedence over --exclude-field-pat.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_concat.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_csv.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_delete_fields.pm view on Meta::CPAN
=item * B<include_fields> => I<array[str]>
Field names to include, takes precedence over --exclude-field-pat.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_fill_cells.pm view on Meta::CPAN
stash, C<$output_row_num> is a 1-based integer (first data row means 1), and
C<$output_field_idx> is the 0-based field index (0 means the first index). Code
is expected to return a boolean value, where true meaning the cell should be
filied.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_freqtable.pm view on Meta::CPAN
=item * B<ignore_case> => I<true>
Ignore case.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_grep.pm view on Meta::CPAN
=item * B<hash> => I<bool>
Provide row in $_ as hashref instead of arrayref.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_intrange.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_lookup_fields.pm view on Meta::CPAN
=item * B<ignore_case> => I<bool>
(No description)
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_ltrim.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_munge_field.pm view on Meta::CPAN
=item * B<field>* => I<str>
Field name.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_munge_rows.pm view on Meta::CPAN
=item * B<hash> => I<bool>
Provide row in $_ as hashref instead of arrayref.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_pick_cells.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_pick_fields.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_pick_rows.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_quote.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_replace_newline.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_rtrim.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_select_fields.pm view on Meta::CPAN
=item * B<include_fields> => I<array[str]>
Field names to include, takes precedence over --exclude-field-pat.
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_select_rows.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_setop.pm view on Meta::CPAN
=item * B<ignore_case> => I<bool>
(No description)
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_shuf_fields.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_shuf_rows.pm view on Meta::CPAN
Arguments ('*' denotes required arguments):
=over 4
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over
lib/App/CSVUtils/csv_sort_fields.pm view on Meta::CPAN
=item * B<ci> => I<bool>
(No description)
=item * B<inplace> => I<true>
Output to the same file as input.
Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.
Some caveats:
=over