Spreadsheet::ParseXLSX3pm
Parse xlsx files
Usage
use Spreadsheet::ParseXLSX;my $parser = Spreadsheet::ParseXLSX->new;my $workbook = $parser->parse("file.xlsx");# see Spreadsheet::ParseExcel for further documentation
Version
version 0.36
Overview
This module is an adaptor for Spreadsheet::ParseExcel that reads XLSX files. For documentation about the various data that you can retrieve from these classes, please see Spreadsheet::ParseExcel, Spreadsheet::ParseExcel::Workbook, Spreadsheet::ParseExcel::Worksheet, and Spreadsheet::ParseExcel::Cell.
Methods
new(%opts)
Returns a new parser instance. Takes a hash of parameters:
- Password
-
Password to use for decrypting encrypted files.
parse($file, $formatter)
Parses an XLSX file. Parsing errors throw an exception. $file can be either a filename or an open filehandle. Returns a Spreadsheet::ParseExcel::Workbook instance containing the parsed data. The $formatter argument is an optional formatter class as described in Spreadsheet::ParseExcel.
Incompatibilities
This module returns data using classes from Spreadsheet::ParseExcel, so for the most part, it should just be a drop-in replacement. That said, there are a couple areas where the data returned is intentionally different:
- Colors
-
In Spreadsheet::ParseExcel, colors are represented by integers which index into the color table, and you have to use
"Spreadsheet::ParseExcel->ColorIdxToRGB"in order to get the actual value out. In Spreadsheet::ParseXLSX, while the color table still exists, cells are also allowed to specify their color directly rather than going through the color table. In order to avoid confusion, I normalize all color values in Spreadsheet::ParseXLSX to their string RGB format ("#0088ff"). This affects the"Fill","BdrColor", and"BdrDiag"properties of formats, and the"Color"property of fonts. Note that the default color is represented by"undef"(the same thing that"ColorIdxToRGB"would return).
- Formulas
-
Spreadsheet::ParseExcel doesn't support formulas. Spreadsheet::ParseXLSX provides basic formula support by returning the text of the formula as part of the cell data. You can access it via
"$cell->{Formula}". Note that the restriction still holds that formula cell values aren't available unless they were explicitly provided when the spreadsheet was written.
Support
You can find this documentation for this module with the perldoc command.
perldoc Spreadsheet::ParseXLSX
You can also look for information at:
- •
-
MetaCPAN
<https://metacpan.org/release/Spreadsheet-ParseXLSX>
- •
-
RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Spreadsheet-ParseXLSX>
- •
-
Github
<https://github.com/MichaelDaum/spreadsheet-parsexlsx>
- •
-
CPAN Ratings
<http://cpanratings.perl.org/d/Spreadsheet-ParseXLSX>
Sponsors
Parts of this code were paid for by
- Socialflow <http://socialflow.com>
Contributors
•
|
Alex <[email protected]> |
|---|---|
•
|
Alexey Mazurin <[email protected]> |
•
|
Daryl Anderman <[email protected]> |
•
|
Dave Clarke <[email protected]> |
•
|
Fitz Elliott <[email protected]> |
•
|
FL <[email protected]> |
•
|
Gareth Tunley <[email protected]> |
•
|
Meredith Howard <[email protected]> |
•
|
Michael Conrad <[email protected]> |
•
|
Michael Daum <[email protected]> |
•
|
Nick Moore <[email protected]> |
•
|
oharakouhei <[email protected]> |
•
|
rdboisvert <[email protected]> |
•
|
Ricardo Signes <[email protected]> |
•
|
Robert Boisvert <[email protected]> |
•
|
Steve Simms <[email protected]> |
•
|
Stuart Watt <[email protected]> |
•
|
theevilapplepie <[email protected]> |
•
|
zhouzhen1 <[email protected]> |
Copyright and license
This software is Copyright (c) 2025 by Jesse Luehrs.
This is free software, licensed under:
The MIT (X11) License
Releases
4 releases since Debian 10 (Buster); the text changed 3 times.