This queue is for tickets about the Spreadsheet-ParseExcel CPAN distribution.
Maintainer(s)' notes
If you are reporting a bug in Spreadsheet::ParseExcel here are some pointers
1) State the issues as clearly and as concisely as possible. A simple program or Excel test file (see below) will often explain the issue better than a lot of text.
2) Provide information on your system, version of perl and module versions. The following program will generate everything that is required. Put this information in your bug report.
#!/usr/bin/perl -w
print "\n Perl version : $]";
print "\n OS name : $^O";
print "\n Module versions: (not all are required)\n";
my @modules = qw(
Spreadsheet::ParseExcel
Scalar::Util
Unicode::Map
Spreadsheet::WriteExcel
Parse::RecDescent
File::Temp
OLE::Storage_Lite
IO::Stringy
);
for my $module (@modules) {
my $version;
eval "require $module";
if (not $@) {
$version = $module->VERSION;
$version = '(unknown)' if not defined $version;
}
else {
$version = '(not installed)';
}
printf "%21s%-24s\t%s\n", "", $module, $version;
}
__END__
3) Upgrade to the latest version of Spreadsheet::ParseExcel (or at least test on a system with an upgraded version). The issue you are reporting may already have been fixed.
4) Create a small example program that demonstrates your problem. The program should be as small as possible. A few lines of codes are worth tens of lines of text when trying to describe a bug.
5) Supply an Excel file that demonstrates the problem. This is very important. If the file is big, or contains confidential information, try to reduce it down to the smallest Excel file that represents the issue. If you don't wish to post a file here then send it to me directly: jmcnamara@cpan.org
6) Say if the test file was created by Excel, OpenOffice, Gnumeric or something else. Say which version of that application you used.
7) If you are submitting a patch you should check with the maintainer whether the issue has already been patched or if a fix is in the works. Patches should be accompanied by test cases.
Asking a question
If you would like to ask a more general question there is the Spreadsheet::ParseExcel Google Group.
Owner: |
Nobody in particular
|
Requestors: |
mailgpa [...] gmail.com
|
Cc: |
|
AdminCc: |
|
|
Severity: |
(no value)
|
Broken in: |
(no value)
|
Fixed in: |
(no value)
|
|
Mon Sep 13 07:29:06 2010
mailgpa [...] gmail.com - Ticket created
Hi!
When a numeric cell starts with apostrophe(') (which it disappearing after
input) its value should be interpreted as text. But the parser tries to
format its value. As the result, " '000 " is being parsed as " 0.00 ".
Perl version : 5.010001
OS name : MSWin32
Module versions: (not all are required)
Spreadsheet::ParseExcel 0.57
Scalar::Util 1.23
Unicode::Map (not installed)
Spreadsheet::WriteExcel (not installed)
Parse::RecDescent 1.965001
File::Temp 0.22
OLE::Storage_Lite 0.19
IO::Stringy 2.110
I've tried to fix this. But since it was not fully tested maybe you can
suggest a better solution.
sub ExcelFmt {
my ( $format_str, $number, $is_1904, $number_type, $want_subformats ) =
@_;
# Return text strings without further formatting.
return $number unless $number =~ $qrNUMBER;
# Fix leading apostrophe issue (mailgpa@gmail.com).
return $number if $number_type eq 'Text';
--
С уважением, / Kind regards,
Павел Голобородько / Pavel Goloborodko
Mon Sep 13 17:02:36 2010
mailgpa [...] gmail.com - Correspondence added
On Mon, Sep 13, 2010 at 3:29 PM, Bugs in Spreadsheet-ParseExcel via RT
<bug-Spreadsheet-ParseExcel@rt.cpan.org> wrote:
Show quoted text>
> Greetings,
>
> This message has been automatically generated in response to the
> creation of a trouble ticket regarding:
> "apostrophe issue",
> a summary of which appears below.
>
> There is no need to reply to this message right now. Your ticket has been
> assigned an ID of [rt.cpan.org #61299]. Your ticket is accessible
> on the web at:
>
>
https://rt.cpan.org/Ticket/Display.html?id=61299
>
> Please include the string:
>
> [rt.cpan.org #61299]
>
> in the subject line of all future correspondence about this issue. To do so,
> you may reply to this message.
>
> Thank you,
> bug-Spreadsheet-ParseExcel@rt.cpan.org
>
> -------------------------------------------------------------------------
> Hi!
>
> When a numeric cell starts with apostrophe(') (which it disappearing after
> input) its value should be interpreted as text. But the parser tries to
> format its value. As the result, " '000 " is being parsed as " 0.00 ".
>
> Perl version : 5.010001
> OS name : MSWin32
> Module versions: (not all are required)
> Spreadsheet::ParseExcel 0.57
> Scalar::Util 1.23
> Unicode::Map (not installed)
> Spreadsheet::WriteExcel (not installed)
> Parse::RecDescent 1.965001
> File::Temp 0.22
> OLE::Storage_Lite 0.19
> IO::Stringy 2.110
>
>
> I've tried to fix this. But since it was not fully tested maybe you can
> suggest a better solution.
>
> sub ExcelFmt {
>
> my ( $format_str, $number, $is_1904, $number_type, $want_subformats ) =
> @_;
>
> # Return text strings without further formatting.
> return $number unless $number =~ $qrNUMBER;
> # Fix leading apostrophe issue (mailgpa@gmail.com).
> return $number if $number_type eq 'Text';
>
> --
> С уважением, / Kind regards,
> Павел Голобородько / Pavel Goloborodko
>
>
--
С уважением, / Kind regards,
Павел Голобородько / Pavel Goloborodko
Message body not shown because it is not plain text.
Thu Sep 16 06:14:20 2010
jmcnamara [...] cpan.org - Correspondence added
Thanks for the example file.
I'll take a look at the issue and let you know.
John.
--
Thu Sep 16 06:14:21 2010
The RT System itself - Status changed from 'new' to 'open'
Thu Sep 16 07:06:13 2010
jmcnamara [...] cpan.org - Correspondence added
Hi,
I found the issue. Here is a workaround until I can fix it in the code.
<code>
#!/usr/bin/perl
use strict;
use warnings;
use Spreadsheet::ParseExcel;
my $parser = Spreadsheet::ParseExcel->new();
my $workbook = $parser->parse('example.xls');
for my $worksheet ( $workbook->worksheets() ) {
my ( $row_min, $row_max ) = $worksheet->row_range();
my ( $col_min, $col_max ) = $worksheet->col_range();
for my $row ( $row_min .. $row_max ) {
for my $col ( $col_min .. $col_max ) {
my $cell = $worksheet->get_cell( $row, $col );
next unless $cell;
my $value_formatted = $cell->value();
my $value_unformatted = $cell->unformatted();
my $format = $cell->get_format();
if ( defined $format && $format->{Key123} ) {
# Use the unformatted valus for 123 style text formats.
$value_formatted = $value_unformatted;
}
print "Row, Col = ($row, $col)\n";
print "Value = ", $value_formatted, "\n";
print "\n";
}
}
}
__END__
</code>
John.
--
Fri Sep 17 05:54:31 2010
mailgpa [...] gmail.com - Correspondence added
Hi John,
it seems that it works. Thanks a lot!
On Fri, Sep 17, 2010 at 3:11 AM, John McNamara via RT
<bug-Spreadsheet-ParseExcel@rt.cpan.org> wrote:
Show quoted text
--
С уважением, / Kind regards,
Павел Голобородько / Pavel Goloborodko
Tue Sep 21 04:41:19 2010
jmcnamara [...] cpan.org - Correspondence added
Fixed in Spreadsheet::ParseExcel version 0.58.
Thanks,
John.
--
Tue Sep 21 04:41:21 2010
jmcnamara [...] cpan.org - Status changed from 'open' to 'resolved'
Tue Sep 21 04:52:04 2010
mailgpa [...] gmail.com - Correspondence added
Thanks John!
On Tue, Sep 21, 2010 at 12:41 PM, John McNamara via RT
<bug-Spreadsheet-ParseExcel@rt.cpan.org> wrote:
Show quoted text
--
С уважением, / Kind regards,
Павел Голобородько / Pavel Goloborodko
Tue Sep 21 04:52:05 2010
The RT System itself - Status changed from 'resolved' to 'open'
Tue Sep 21 05:15:16 2010
jmcnamara [...] cpan.org - Status changed from 'open' to 'resolved'