Catman...::XLSX(3pm)

πŸ“¦
version 0.11 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

✨ Catmandu::Importer::XLSX ✨

okay bestie, gather round πŸ’– this is the Catmandu::Importer::XLSX page, straight out of the User Contributed Perl Documentation section of the manual (the (3pm) vibe, iykyk). She's a package that imports XLSX files, and she is, lowkey, a whole icon. Let's get into it πŸ¦‹


🌸 NAME 🌸

Catmandu::Importer::XLSX β€” the package that imports XLSX files. that's it, that's the whole job, and she does it flawlessly πŸ’…


✨ SYNOPSIS ✨

so here's how you actually run her. command line first, bestie:

# On the command line
$ catmandu convert XLSX < ./t/test.xlsx
$ catmandu convert XLSX --header 0 < ./t/test.xlsx
$ catmandu convert XLSX --fields 1,2,3 < ./t/test.xlsx
$ catmandu convert XLSX --columns 1 < ./t/test.xlsx
$ catmandu convert XLSX --worksheet 1 < ./t/test.xlsx

and if you're a Perl girlie (respect), here's your moment 🫢

# Or in Perl
use Catmandu::Importer::XLSX;

my $importer = Catmandu::Importer::XLSX->new(file => "./t/test.xlsx");

my $n = $importer->each(sub {
    my $hashref = $_[0];
    # ...
});

like… the each with a callback? main character energy fr fr. πŸ”₯


πŸŽ€ DESCRIPTION πŸŽ€

Catmandu importer for XLSX files. short, sweet, does not miss. πŸ’–


πŸ’… METHODS πŸ’…

not me about to tell you the most blessed news: this module inherits all methods of Catmandu::Importer and by this Catmandu::Iterable. so everything your faves can do? she can do too. no cap. πŸ‘‘


🌈 CONFIGURATION 🌈

so besides all the configuration that Catmandu::Importer already hands you ("file", "fh", etc. β€” you know the ones), this importer can be configured with the following parameters. obsessed with the range honestly ✨

  • header β€” by default, object fields get read from the XLS header line. but if there's no header line available, the object fields are just named as column coordinates (A,B,C,...). Default: 1. πŸ“
  • fields β€” give her custom object field names, as an array, a hash reference, or a comma-separated list. your fields, your rules. πŸ’œ
  • columns β€” when the 'columns' option is provided, the object fields get named as column coordinates (A,B,C,...). Default: 0. πŸŽ€
  • empty β€” how to treat empty fields in the data. here's the tea:
    • when the option value is 'string', the empty values will be empty strings
    • when the option value is 'nil', the empty values will get turned into undefined fields
    • when the option is 'ignore', the empty values are ignored
    • Default is 'string'.
  • worksheet β€” if the Excel workbook contains more than one worksheet, you can select a specific worksheet by its index number (0,1,2,...). Default: 0. πŸ¦‹

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, bestie, they're all part of the family:

  • Catmandu::Importer
  • Catmandu::Iterable
  • Catmandu::Importer::CSV
  • Catmandu::Importer::XLS

ok that's the whole page!! no skips, no skimming, we read every single line together like the icons we are πŸ’–

and as a lil sign-off from me to you: this one's running on perl v5.40.1, dated 2026-01-24, and it lives under the manual page name Catman...::XLSX(3pm). slay, periodt, bye bestie 🫢🌸✨

πŸ“¦ where this page comes from