![]() |
|
Just another Perl shrine | |
PerlMonks |
The XLSX Perl modules have a simple problemby BerntB (Deacon) |
on Jun 14, 2019 at 09:27 UTC ( [id://11101336]=perlmeditation: print w/replies, xml ) | Need Help?? |
Hi, I write here so people can find the problem when they search. XLSX is a Zipped file format with XML. When some applications (it seems Libre Office and others) save as XLSX, they set the dimension size bad. And all the Perl modules I could find failed on that. A typical example is that in a sheet file (like xl/worksheets/sheet1.xml, after unpacking) you find <dimension ref="G2296"/>The Spreadsheet::ParseXLSX module (and others) seems to expect something like "A1:G2296" there. It sets the values for Min/Max Column/Row wrong. Spreadsheet::ParseXLSX use Spreadsheet::ParseExcel objects for worksheets etc, so the API is compatible. The get_cell() method there just returns undef if the asked cell is outside the dimension boundaries (which it of course is). A temporary fix would be to set the MinRow/MinCol/MaxCol/MaxRow values in the spreadsheet object:
I don't really know enough about the XLSX format. I assume the easy solution is a few lines. Like keeping up max/min column numbers when reading the file. I'll send in a bugfix when I get so far. (With tests so I don't get any grumbles back this time. :-) )
Back to
Meditations
|
|