Spreadsheet::XLSX(3)

πŸ’– Spreadsheet::XLSX(3) πŸ’–

okay so picture this: it's the Perl world, it's 2008, and somebody needs to read .xlsx files. that someone is you, bestie, and this page is your manual β€” Spreadsheet::XLSX, straight out of User Contributed Perl Documentation. buckle up πŸŽ€


✨ NAME ✨

Spreadsheet::XLSX β€” a Perl extension for reading MS Excel 2007 files. that's it, that's the whole gig πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe in code, no notes:

use Text::Iconv;
my $converter = Text::Iconv->new("utf-8", "windows-1251");

# Text::Iconv is not really required.
# This can be any object with the convert method. Or nothing.

use Spreadsheet::XLSX;

my $excel = Spreadsheet::XLSX->new('test.xlsx', $converter);

foreach my $sheet (@{$excel->{Worksheet}}) {

    printf("Sheet: %s\n", $sheet->{Name});

    $sheet->{MaxRow} ||= $sheet->{MinRow};

    foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow}) {

        $sheet->{MaxCol} ||= $sheet->{MinCol};

        foreach my $col ($sheet->{MinCol} ..  $sheet->{MaxCol}) {

            my $cell = $sheet->{Cells}[$row][$col];

            if ($cell) {
                printf("( %s , %s ) => %s\n", $row, $col, $cell->{Val});
            }

        }

    }

}

note the lil comment up top fr fr: Text::Iconv is not really required β€” it can be any object with a convert method. or, like, literally nothing. your call bestie 🫢


🌸 DESCRIPTION 🌸

okay so what this module does: it's a (quick and dirty) emulation of Spreadsheet::ParseExcel but for the Excel 2007 .xlsx file format. it supports styles and many of Excel's quirks β€” but not all of them, and we're being honest about that πŸ’€

the way it works is it populates the classes from Spreadsheet::ParseExcel for interoperability, and those include Workbook, Worksheet, and Cell. so if you already know your way around ParseExcel, you're lowkey already home 🏠✨


πŸ”₯ SEE ALSO πŸ”₯

this section is giving very much "here's everyone else in the group chat":

  • Spreadsheet::ParseXLSX β€” okay so real talk πŸ™ˆ this module (Spradsheet::XLSX) has some serious issues with the way it uses regexs for parsing the XML. "I would strongly encourage switching to Spreadsheet::ParseXLSX which takes a more reliable approach." β€” and honestly? they said what they said, and it's in the manual, so πŸ’…
  • Text::CSV_XS, Text::CSV_PP β€” the CSV girlies πŸ“
  • Spreadsheet::ParseExcel β€” the OG
  • Spreadsheet::ReadSXC β€” sibling energy
  • Spreadsheet::BasicRead β€” for that xlscat likewise functionality (Excel only ⚠️)
  • Spreadsheet::ConvertAA β€” for an alternative set of cell2cr() / cr2cell() pair πŸ‘‘
  • Spreadsheet::Perl β€” offers a Pure Perl implementation of a spreadsheet engine. users that want this format to be supported in Spreadsheet::Read are hereby motivated to offer patches. "It's not high on my todo-list." 😭 iconic honesty
  • xls2csv β€” https://metacpan.org/release/KEN/xls2csv-1.07 offers an alternative for my "xlscat -c", in the xls2csv tool, but this tool focusses on character encoding transparency, and requires some other modules. ngl, niche but useful 🌈
  • Spreadsheet::Read β€” read the data from a spreadsheet (interface module) ✨

πŸ‘‘ AUTHOR πŸ‘‘

Dmitry Ovsyanko, <do@eludia.ru>, http://eludia.ru/wiki/ β€” the main character here fr fr 🫢

Patches by:

        Steve Simms
        Joerg Meltzer
        Loreyna Yeung
        Rob Polocz
        Gregor Herrmann
        H.Merijn Brand
        endacoe
        Pat Mariani
        Sergey Pushkin

these legends all pitched in and we are obsessed πŸ’–


🧚 ACKNOWLEDGEMENTS 🧚

        Thanks to TrackVia Inc. (http://www.trackvia.com) for paying for Rob Polocz working time.

sponsoring dev time so the rest of us can read spreadsheets? slay, no cap 🌟


Copyright (C) 2008 by Dmitry Ovsyanko

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. πŸŽ€


and that's the whole page bestie, mwah πŸ’…βœ¨ β€” this beautiful thing was generated by perl v5.42.0 on 2024-03-22, and it's filed under Spreadsheet::XLSX(3). go read some spreadsheets, you got this πŸ¦‹πŸ’–

πŸ“¦ where this page comes from