Catman...::XLSX(3pm)
π Catmandu::Exporter::XLSX β the whole vibe π
okay bestie, so this page lives in the Catman...::XLSX part of the 3pm manual (yes that's the name, we don't make the rules) and it's literally all about Catmandu::Exporter::XLSX, which is β drumroll please π₯ β a XLSX exporter. That's it. That's the name section. Slay.
β¨ SYNOPSIS β¨
first up, the command line era, because she contains multitudes:
# 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
and now the Perl girlies get their moment π«Ά
# 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;
look at her go. add, add_many, commit, then flexing with count. main character energy fr fr. π
πΈ DESCRIPTION πΈ
Catmandu exporter for Excel XLSX files. that's the whole thing. she takes your data and she makes it a spreadsheet. iconic behavior, no notes. π
π¦ METHODS π¦
want the full list of methods? bestie you gotta go read Catmandu::Exporter, Catmandu::Addable, Catmandu::Fixable, Catmandu::Counter, and Catmandu::Logger. they've got the whole menu. this page is just the XLSX-specific corner of the group chat. π
π CONFIGURATION π
so besides all the config that Catmandu::Exporter already hands you (think "file", "fh", etc. β the classics), this importer can be configured with the following parameters. yes it says "importer" in the original and yes we're keeping it, don't @ me:
headerβ include a header line with the column names? set it to1and you get one. that's the default, so if you say nothing you still get a header. πfieldsβ the list of fields that get used as columns. hand it over as an array reference or as a comma-separated string, dealer's choice.columnsβ the list of custom column names. again: array reference, or a comma-separated list. β¨collect_fieldsβ okay this one's the overthinker of the group. turn it on and she will first read the complete stream so she can build a complete list of fields to export. leave it off and only the fields from the first record get exported β or, if you used the"fields"option, just the ones you named there. so if your records are all "surprise! I have extra keys", this is your girl. π
π§ SEE ALSO π§
go give these two a follow, they're in the same friend group:
Catmandu::Exporter::CSVCatmandu::Exporter::XLS
lowkey a whole manual page and she ate. π
and that's the tea, bestie β this page is from perl v5.40.1, dated 2026-01-24, and it was written by the User Contributed Perl Documentation girlies (that's the Catman...::XLSX(3pm) corner of the internet, iykyk). stay slay, go export something pretty. πβ¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-xls-perl 0.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-xls-perl 0.11-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms