Subject: | Feature request for Spreadsheet-ParseExcel-Simple |
Date: | Fri, 12 Dec 2008 11:54:00 -0500 |
To: | bug-Spreadsheet-ParseExcel-Simple [...] rt.cpan.org |
From: | Akbar Nurlybayev <akbar [...] oanda.com> |
Dear Tony Bowden,
I am using the latest version (1.04) of your
Spreadsheet-ParseExcel-Simple module. Recently I've run in to problem
with Excel dates being converted differently on different machines. This
is one of the known problems described on Spreadsheet-ParseExcel page:
http://search.cpan.org/dist/Spreadsheet-ParseExcel/lib/Spreadsheet/ParseExcel.pm#KNOWN_PROBLEMS
Basically following code:
for my $sheet ( $xls->sheets ){
while ( $sheet->has_data ) {
my @data = $sheet->next_row;
next unless $data[0] and $data[0] =~ /^\d/;
print "$data[0]\n";
}
}
Returns:
1-1-08
2-1-08
3-1-08
4-1-08
5-1-08
6-1-08
7-1-08
8-1-08
9-1-08
on Linux machine and
2008-01-01
2008-02-01
2008-03-01
2008-04-01
2008-05-01
2008-06-01
2008-07-01
2008-08-01
2008-09-01
on OpenSolaris
The dates in Excel file column are in 01/09/2008 format.
As a feature request I'd like to suggest to add a version of next_row()
method that returns raw Excel row content. For example if you could just
add something like:
sub next_row_raw {
map { $_ ? $_->{Val} : "" } @{$_[0]->{sheet}->{Cells}[$_[0]->{row}++]};
}
This way I can get consistent dates, for example, using
DateTime-Format-Excel module for converting raw Excel date column, for
both machines.
Regards,
Akbar.