App-CSVUtils-csv_mix_formulas

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        *   things can also fail if permissions are restrictive;

    *   inplace_backup_ext => *str* (default: "")

        Extension to add for backup of input file.

        In inplace mode ("--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.

    *   input_escape_char => *str*

        Specify character to escape value in field in input CSV, will be
        passed to Text::CSV_XS.

        Defaults to "\\" (backslash). Overrides "--input-tsv" option.

    *   input_filenames => *array[filename]* (default: ["-"])

        Input CSV files.

        Use "-" to read from stdin.

README  view on Meta::CPAN

        Text::CSV_XS.

        Defaults to "," (comma). Overrides "--input-tsv" option.

    *   input_tsv => *true*

        Inform that input file is in TSV (tab-separated) format instead of
        CSV.

        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.

    *   output_always_quote => *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"

    *   output_escape_char => *str*

        Specify character to escape value in field in output CSV, will be
        passed to Text::CSV_XS.

        This is like "--input-escape-char" option but for output instead of
        input.

        Defaults to "\\" (backslash). Overrides "--output-tsv" option.

    *   output_filename => *filename*

        Output filename.

        Use "-" to output to stdout (the default if you don't specify this
        option).

README  view on Meta::CPAN

        Defaults to "," (comma). Overrides "--output-tsv" option.

    *   output_tsv => *bool*

        Inform that output file is TSV (tab-separated) format instead of
        CSV.

        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.

    *   overwrite => *bool*

        Whether to override existing output file.

    *   weight_field => *str*

        Specify field which contain the weights.

lib/App/CSVUtils/csv_mix_formulas.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_mix_formulas.pm  view on Meta::CPAN

=item * B<input_sep_char> => I<str>

Specify field separator character in input CSV, will be passed to Text::CSV_XS.

Defaults to C<,> (comma). Overrides C<--input-tsv> option.

=item * B<input_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_mix_formulas.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<weight_field> => I<str>

Specify field which contain the weights.

script/csv-mix-formulas  view on Meta::CPAN

=head1 VERSION

This document describes version 0.002 of csv-mix-formulas (from Perl distribution App-CSVUtils-csv_mix_formulas), released on 2024-02-24.

=head1 SYNOPSIS

B<csv-mix-formulas> B<L<--help|/"--help, -h, -?">> (or B<L<-h|/"--help, -h, -?">>, B<L<-?|/"--help, -h, -?">>)

B<csv-mix-formulas> B<L<--version|/"--version, -v">> (or B<L<-v|/"--version, -v">>)

B<csv-mix-formulas> [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<--ingredient-...

=head1 DESCRIPTION

Each formula is a CSV comprised of at least two fields. The first field (by
default literally the first field, but can also be specified using
C<--ingredient-field>) is assumed to contain the name of ingredients. The second
field (by default literally the second field, but can also be specified using
C<--weight-field>) is assumed to contain the weight of ingredients. A percent
form is recognized and will be converted to its decimal form (e.g. "60%" or
"60.0 %" will become 0.6).

script/csv-mix-formulas  view on Meta::CPAN

=item B<--output-percent-nosign>

If enabled, will convert output weights to percent without the percent sign (e.g. 0.6 to "60").

=back

=head2 Input options

=over

=item B<--input-escape-char>=I<s>

Specify character to escape value in field in input CSV, will be passed to Text::CSV_XS.

Defaults to C<\\> (backslash). Overrides C<--input-tsv> option.


=item B<--input-filename>=I<s@>

Input CSV files.

Default value:

script/csv-mix-formulas  view on Meta::CPAN


Specify field separator character in input CSV, will be passed to Text::CSV_XS.

Defaults to C<,> (comma). Overrides C<--input-tsv> option.


=item B<--input-tsv>

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<--no-input-header>

Specify that input CSV does not have a header row.

By default, the first row of the input CSV will be assumed to contain field
names (and the second row contains the first data row). When you declare that

script/csv-mix-formulas  view on Meta::CPAN


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<s>

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<s>, B<-o>

Output filename.

Use C<-> to output to stdout (the default if you don't specify this option).

script/csv-mix-formulas  view on Meta::CPAN


Defaults to C<,> (comma). Overrides C<--output-tsv> option.


=item B<--output-tsv>

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>, B<-O>

Whether to override existing output file.

=item B<--page-result>



( run in 0.436 second using v1.01-cache-2.11-cpan-c21f80fb71c )