List Info

Thread: parsing error: values from different sheets mixed together




parsing error: values from different sheets mixed together
user name
2006-12-14 14:10:44
hello. <br />
<p>
i'm using activeperl version 5.6 and spreadsheet::parseexcel
version 0.2603 <br />
</p>
<p>
i found the following problem to occur <b>whenever a
worksheet has more than one chart</b>: <br />
the parser behaves as if it fused sheets together, the next
overwriting the first whenever cells in the next sheet are
defined. <br />
this results in data loss for the first sheet. <br />
</p>
<p>
below is a simple example to illustrate the behavior: <br
/>
1,2,3,4 is in the first sheet, a,b,c is in the next, we
expect this:
</p>
<code> 
--------- SHEET:Sheet1 
( 0 , 0 ) -- 1
( 1 , 0 ) -- 2
( 2 , 0 ) -- 3
( 3 , 0 ) -- 4
--------- SHEET:Sheet2
( 0 , 0 ) -- a
( 1 , 0 ) -- b
( 2 , 0 ) -- c
</code>

instead we get the following (using the script below. and
the file is attached if i find out how to)
<code> 
--------- SHEET:Sheet1
( 0 , 0 ) -- a
( 1 , 0 ) -- b
( 2 , 0 ) -- c
( 3 , 0 ) -- 4
--------- SHEET:Sheet2
</code>

<br />
n.b. if you swap the positions of the two sheets, you get
the correct behavior. <br />

<code> 
use strict;
use Spreadsheet::ParseExcel;

my $oBook =
Spreadsheet::ParseExcel::Workbook->Parse('bench21.xls');

my($iR, $iC, $oWkS, $oWkC, $sheetnumber); $sheetnumber=0;

foreach my $oWkS ({$oBook->}) {
$sheetnumber++;    

	print "--------- SHEET:", $oWkS->,
"n";

	for(my $iR = $oWkS-> ; defined
$oWkS-> && $iR <= $oWkS-> ;
$iR++) {

		for(my $iC = $oWkS-> ; defined
$oWkS-> && $iC <= $oWkS-> ;
$iC++) {
			$oWkC = $oWkS->[$iR][$iC];
			print "( $iR , $iC ) -- ", $oWkC->Value,
"n" if($oWkC);
        	}
        }
}
</code>

of course i could strip my files of all its graphics, but
unless someone knows how to do that non-manually, i won't. 
<br /> 
also, i noticed a rather similar bug report. the two could
be linked, but its status is new... :( <br /> 
(id 13273:Unable to parse Excel 2003 spreadsheet with charts
containing external references) <br /> 
thanks for any help

To write a respons, access
http://ww
w.cpanforum.com/response_form/3768

To see the full thread, access
http://www.cpan
forum.com/threads/3768

--
You are getting this messages from www.cpanforum.com
To change your subscription information visit http://www.cpanforum.
com/mypan/

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )