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 toSpreadsheet::ParseXLSXwhich 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 OGSpreadsheet::ReadSXCβ sibling energySpreadsheet::BasicReadβ for that xlscat likewise functionality (Excel only β οΈ)Spreadsheet::ConvertAAβ for an alternative set ofcell2cr()/cr2cell()pair πSpreadsheet::Perlβ offers a Pure Perl implementation of a spreadsheet engine. users that want this format to be supported inSpreadsheet::Readare hereby motivated to offer patches. "It's not high on my todo-list." π iconic honestyxls2csvβhttps://metacpan.org/release/KEN/xls2csv-1.07offers an alternative for my"xlscat -c", in thexls2csvtool, 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 AND LICENSE π
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
- opensuse-leap 16.0: perl-Spreadsheet-XLSX 0.180.0-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms