DOKK / manpages / debian 10 / libcatmandu-xls-perl / Catmandu::Exporter::XLSX.3pm.en
Catmandu::Exporter::XLSX(3pm) User Contributed Perl Documentation Catmandu::Exporter::XLSX(3pm)

Catmandu::Exporter::XLSX - a XLSX exporter

    # On the command line
    $ printf "a,b,c\n1,2,3" | catmandu convert CSV to XLSX --file test.xlsx
    $ printf "a,b,c\n1,2,3" | catmandu convert CSV to XLSX --file test.xlsx --header 0
    $ printf "a,b,c\n1,2,3" | catmandu convert CSV to XLSX --file test.xlsx --fields a,c
    $ printf "a,b,c\n1,2,3" | catmandu convert CSV to XLSX --file test.xlsx --fields a,c --columns ALPHA,CHARLIE
    # Or in Perl
    use Catmandu::Exporter::XLSX;
    my $exporter = Catmandu::Exporter::XLSX->new(
                file => 'test.xlsx',
                fields => 'a,b,c',
                columns => 'ALPHA,BRAVO,CHARLIE',
                header => 1);
    $exporter->add({a => 1, b => 2, c => 3});
    $exporter->add_many($arrayref);
    $exporter->commit;
    printf "exported %d objects\n" , $exporter->count;

Catmandu exporter for Excel XLSX files.

See Catmandu::Exporter, Catmandu::Addable, Catmandu::Fixable, Catmandu::Counter, and Catmandu::Logger for a full list of methods.

In addition to the configuration provided by Catmandu::Exporter ("file", "fh", etc.) the importer can be configured with the following parameters:

Include a header line with column names, if set to 1 (default).
List of fields to be used as columns, given as array reference or comma-separated string
List of custom column names, given as array reference or comma-separated list.

Catmandu::Exporter::CSV, Catmandu::Exporter::XLS.

2018-05-05 perl v5.26.2