App-TextTableUtils

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN



0.009   2023-03-10  Released-By: PERLANCAR; Urgency: medium

        - Set header row when outputting as texttable, ansitabale,
          asciitable.


0.008   2022-02-18  Released-By: PERLANCAR; Urgency: medium

        - [bugfix] Revert back 0.007's decision to set escape_char to '\'
          because the common default is '"'.


0.007   2022-02-18  Released-By: PERLANCAR; Urgency: medium; Backward-Incompatible: yes; Broken: yes

        - Allow customizing CSV's escape_char with --escape-char.

        - [backward incompatible] CSV parser is instantiated with escape_char
          set to '\' (backslash) to handle backslash escaping. Also, the
          precedence of --tsv is increased to preced --csv-sep et al. UPDATE:
          reversed in 0.008.


0.006   2021-03-20  Released-By: PERLANCAR; Urgency: medium

	- Add command line options --csv-sep & --csv-loose for CSV input files
	  which are then passed along to Text::CSV. The two options allow to
	  specify the separator character(s) in the CSV file (--csv-sep ";", -s)

script/csv2ansitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/csv2ansitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/csv2ansitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/csv2asciitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/csv2asciitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/csv2asciitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/csv2dd  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/csv2dd  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/csv2dd  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/csv2json  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/csv2json  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/csv2json  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/csv2mdtable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/csv2mdtable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/csv2mdtable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/csv2orgtable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/csv2orgtable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/csv2orgtable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/csv2texttable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/csv2texttable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/csv2texttable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/dd2ansitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/dd2ansitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/dd2ansitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/dd2asciitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/dd2asciitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/dd2asciitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/dd2csv  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/dd2csv  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/dd2csv  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/dd2mdtable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/dd2mdtable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/dd2mdtable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/dd2orgtable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/dd2orgtable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/dd2orgtable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/dd2texttable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/dd2texttable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/dd2texttable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/dd2tsv  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/dd2tsv  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/dd2tsv  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/ini2ansitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/ini2ansitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/ini2ansitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/ini2asciitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/ini2asciitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/ini2asciitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/ini2csv  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/ini2csv  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/ini2csv  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/ini2mdtable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/ini2mdtable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/ini2mdtable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/ini2orgtable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/ini2orgtable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/ini2orgtable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/ini2texttable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/ini2texttable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/ini2texttable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/ini2tsv  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/ini2tsv  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/ini2tsv  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/iod2ansitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/iod2ansitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/iod2ansitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/iod2asciitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/iod2asciitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/iod2asciitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/iod2csv  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/iod2csv  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/iod2csv  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/iod2mdtable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/iod2mdtable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/iod2mdtable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/iod2orgtable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/iod2orgtable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/iod2orgtable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/iod2texttable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/iod2texttable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/iod2texttable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/iod2tsv  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/iod2tsv  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/iod2tsv  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.

script/json2ansitable  view on Meta::CPAN

# parse options
my %Opts;
{
    require Getopt::Long;
    Getopt::Long::Configure("bundling", "no_ignore_case", "permute", "no_getopt_compat");
    Getopt::Long::GetOptions(
        "backend|b=s" => \$Opts{backend},
        "transpose|t" => \$Opts{transpose},
        "csv-sep|s=s" => \$Opts{csv_sep},
        "csv-quote|q=s" => \$Opts{csv_quote},
        "csv-escape|e=s" => \$Opts{csv_escape},
        "csv-loose|l" => \$Opts{csv_loose}
    ) or die "$0: Error in getting options, bailing out\n";
}

# get input handle
my $fh;
{
    if (@ARGV == 1) {
        open $fh, "<:encoding(utf8)", $ARGV[0] or die "Can't open $ARGV[0]: $!";
    } elsif (!@ARGV) {

script/json2ansitable  view on Meta::CPAN

    if ($ifmt eq 'csv') {
        require Text::CSV;
        my $csv = Text::CSV->new({ binary => 1 })
            or die "Cannot use CSV: ".Text::CSV->error_diag;
        if ($Opts{csv_sep}) {
            $csv->sep_char($Opts{csv_sep});
        }
        if ($Opts{csv_quote}) {
            $csv->quote_char($Opts{csv_quote});
        }
        if ($Opts{csv_escape}) {
            $csv->escape_char($Opts{csv_escape});
        }
        if ($Opts{csv_loose}) {
            $csv->allow_loose_quotes(1);
            $csv->allow_loose_escapes(1);
        }
        $rows = [];
        while ( my $row = $csv->getline($fh) ) {
            push @$rows, $row;
        }
        $csv->eof or $csv->error_diag();
    } elsif ($ifmt eq 'tsv') {
        $rows = [];
        while (my $row = <$fh>) {
            chomp $row;

script/json2ansitable  view on Meta::CPAN


Transpose table prior to output.

=head2 --csv-sep (-s)

Use the character(s) specified by this option, when input is a CSV files with a
different separator.

=head2 --csv-loose (-l)

Enable C<allow_loose_escapes> and C<allow_loose_quotes> in L<Text::CSV> (the
backend used to read CSV files).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-TextTableUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-TextTableUtils>.



( run in 1.401 second using v1.01-cache-2.11-cpan-5467b0d2c73 )