NAME

Spreadsheet::ParseXLSX - parse XLSX files

VERSION

version 0.13

SYNOPSIS

use Spreadsheet::ParseXLSX;

my $parser = Spreadsheet::ParseXLSX->new;
my $workbook = $parser->parse("file.xlsx");
# see Spreadsheet::ParseExcel for further documentation

DESCRIPTION

This module is an adaptor for Spreadsheet::ParseExcel that reads XLSX files.

METHODS

new

Returns a new parser instance. Takes no parameters.

parse($file)

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.

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.

BUGS

Worksheets without the dimension tag are not supported
Intra-cell formatting is discarded
Diagonal border styles are ignored

In addition, there are still a few areas which are not yet implemented (the XLSX spec is quite large). If you run into any of those, bug reports are quite welcome.

Please report any bugs to GitHub Issues at https://github.com/doy/spreadsheet-parsexlsx/issues.

SEE ALSO

Spreadsheet::ParseExcel: The equivalent, for XLS files.

Spreadsheet::XLSX: An older, less robust and featureful implementation.

SUPPORT

You can find this documentation for this module with the perldoc command.

perldoc Spreadsheet::ParseXLSX

You can also look for information at:

SPONSORS

Parts of this code were paid for by

Socialflow http://socialflow.com

AUTHOR

Jesse Luehrs <doy@tozt.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by Jesse Luehrs.

This is free software, licensed under:

The MIT (X11) License