Subject: | Error in cellValue with adjacent Zeros |
While reading an ods-file there occurs an error
when there are adjacent fields containing '0'.
It looks like they are treated as just one column:
Here is small example:
In the example files i created a table with
a content like
1 0 0 3 4 5
1 2 3 4 5 6
5 4 3 0 0 1
This is read by the example program like
Table has 4 rows and 6 columns
row 0 : "" "" "" "" "" "" ""
row 1 : "" "1" "0" "3" "4" "5" ""
row 2 : "" "1" "2" "3" "4" "5" "6"
row 3 : "" "5" "4" "3" "0" "1" ""
row 4 : "" "" "" "" "" "" ""
I used
OpenOffice-OODoc-2.035.tar.gz
perl, v5.8.8 built for i486-linux-gnu-thread-multi
on linux - debian etch
Linux tux 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux
Subject: | readdata.pl |
#!/usr/bin/perl
use OpenOffice::OODoc;
my $workbook = ooDocument(file => 'data.ods');
my ($rows, $cols) = $workbook->getTableSize(0);
print "Table has $rows rows and $cols columns\n";
for ( $row=0; $row<=$rows; $row++ )
{
print " row $row : ";
for ( $col=0; $col<=$cols; $col++ )
{
print ' "' . $workbook->cellValue(0,$row,$col).'"';
}
print "\n";
}