Subject: | Issue: Democode mixes up sheets (Spreadsheet-ParseExcel-0.2602) |
Date: | Thu, 8 Sep 2011 16:00:06 +0200 |
To: | "bug-Spreadsheet-ParseExcel [...] rt.cpan.org" <bug-Spreadsheet-ParseExcel [...] rt.cpan.org> |
From: | Peter TUFVESSON <peter.xt.tufvesson [...] stericsson.com> |
Hello,
First of all - thank you for a very nice contribution!
However, I found one excel file which was not parsed properly by your democode.
I have attached the excel file in question. Very simple. But I notice the file size is still quite big, so perhaps the file is corrupted in some way.
It was created using Excel 2007 (12.0.6557.5000) SP2 MSO (12.0.6554.5001)
Below is the code I run. It is an exact copy of the democode you provided. (Just changed the file name)
****** Code *************
use strict;
use Spreadsheet::ParseExcel;
my $oBook =
Spreadsheet::ParseExcel::Workbook->Parse('test.xls');
my($iR, $iC, $oWkS, $oWkC);
foreach my $oWkS (@{$oBook->{Worksheet}}) {
print "--------- SHEET:", $oWkS->{Name}, "\n";
for(my $iR = $oWkS->{MinRow} ;
defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) {
for(my $iC = $oWkS->{MinCol} ;
defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) {
$oWkC = $oWkS->{Cells}[$iR][$iC];
print "( $iR , $iC ) =>", $oWkC->Value, "\n" if($oWkC);
}
}
}
And below is the result:
******* Result ************
C:\Doclists>test.pl
--------- SHEET:A
( 0 , 0 ) =>a
( 0 , 1 ) =>b
( 0 , 2 ) =>c
( 0 , 3 ) =>d
--------- SHEET:B
C:\Doclists>
According to ParseExcel, sheet A has the cells "a,b,c,d". But if you open the excel file, Sheet A does actually have cells "e,f,g,h".
According to ParseExcel, sheet B has no cells. But if you open the excel file, Sheet A does actually have cells "a,b,c,d".
Below you see I am using Windows XP.
******* Perl version ************
C:\Doclists>perl -v
This is perl 5, version 12, subversion 3 (v5.12.3) built for MSWin32-x86-multi-t
hread
(with 9 registered patches, see perl -V for more detail)
Copyright 1987-2010, Larry Wall
Binary build 1204 [294330] provided by ActiveState http://www.ActiveState.com
Built Feb 9 2011 14:38:22
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
***********************
Please see what might have happened.
Thanks again
Peter
Message body not shown because it is not plain text.