Hey,
since version 0.33 i have a problem with a value in my spreadsheet
t.xls. Row 2 column D (1,3) in t.xls contains "19.2".
But the parser in version 0.33 returns -1.60038629962926e-162 instead of
19.2.
I have a little test script based on the one from cpan for this output:
Spreadsheet::ParseExcel: 0.33
Output:
( 0 , 4 ) => bitmap (Type: Text,Length: 6)
( 0 , 5 ) => today (Type: Text,Length: 5)
( 0 , 6 ) => silly field (with random characters) (Type: Text,Length: 36)
( 1 , 0 ) => 45235 (Type: Numeric,Length: 5)
( 1 , 1 ) => sdfgdfg (Type: Text,Length: 7)
( 1 , 2 ) => 7 (Type: Numeric,Length: 1)
( 1 , 3 ) => -1.60038629962926e-162 (Type: Numeric,Length: 22)
( 1 , 5 ) => 37726 (Type: Numeric,Length: 5)
( 1 , 6 ) => I like cake (Type: Text,Length: 11)
Sheet: Sheet2
Sheet: Sheet3
Spreadsheet::ParseExcel: 0.32
Output:
Sheet: Sheet1
( 0 , 0 ) => ID (Type: Text,Length: 2)
( 0 , 1 ) => text (Type: Text,Length: 4)
( 0 , 2 ) => number (Type: Text,Length: 6)
( 0 , 3 ) => math (Type: Text,Length: 4)
( 0 , 4 ) => bitmap (Type: Text,Length: 6)
( 0 , 5 ) => today (Type: Text,Length: 5)
( 0 , 6 ) => silly field (with random characters) (Type: Text,Length: 36)
( 1 , 0 ) => 45235 (Type: Numeric,Length: 5)
( 1 , 1 ) => sdfgdfg (Type: Text,Length: 7)
( 1 , 2 ) => 7 (Type: Numeric,Length: 1)
( 1 , 3 ) => 19.2 (Type: Numeric,Length: 4)
( 1 , 5 ) => 37726 (Type: Numeric,Length: 5)
( 1 , 6 ) => I like cake (Type: Text,Length: 11)
Sheet: Sheet2
Sheet: Sheet3
My Perl Version is 5.8.8, only Spreadsheet::ParseExcel version has been
changed between tests.
t.xls is attached.
--- Test Script:
#!/usr/bin/env perl
use strict;
use warnings;
use Spreadsheet::ParseExcel;
my $excel = Spreadsheet::ParseExcel::Workbook->Parse('t.xls');
foreach my $sheet (@{$excel->{Worksheet}}) {
printf("Sheet: %s\n", $sheet->{Name});
$sheet->{MaxRow} ||= $sheet->{MinRow};
foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow}) {
$sheet->{MaxCol} ||= $sheet->{MinCol};
foreach my $col ($sheet->{MinCol} .. $sheet->{MaxCol}) {
my $cell = $sheet->{Cells}[$row][$col];
if ($cell) {
printf("( %s , %s ) => %s (Type: %s,Length: %i)\n", $row,
$col, $cell->{Val},$cell->{Type},length($cell->{Val}));
}
}
}
}
Thanks and best regards
robert