Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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.

Report information
The Basics
Id: 61299
Status: resolved
Priority: 0/
Queue: Spreadsheet-ParseExcel

People
Owner: Nobody in particular
Requestors: mailgpa [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: apostrophe issue
Date: Mon, 13 Sep 2010 15:28:15 +0400
To: bug-Spreadsheet-ParseExcel [...] rt.cpan.org
From: Pavel Goloborodko <mailgpa [...] gmail.com>
Download (untitled) / with headers
text/plain 1.2k
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
Subject: Re: [rt.cpan.org #61299] AutoReply: apostrophe issue
Date: Tue, 14 Sep 2010 01:01:45 +0400
To: bug-Spreadsheet-ParseExcel [...] rt.cpan.org
From: Pavel Goloborodko <mailgpa [...] gmail.com>
Download (untitled) / with headers
text/plain 2.4k
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
Download example.xls
application/vnd.ms-excel 17.5k

Message body not shown because it is not plain text.

Thanks for the example file. I'll take a look at the issue and let you know. John. --
Download (untitled) / with headers
text/plain 1.1k
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. --
Download (untitled) / with headers
text/plain 177b
Hi, There is a fix for this in the repo on Github. http://github.com/jmcnamara/spreadsheet-parseexcel Can you try it out and let me know if it resolves the issue. John. --
Subject: Re: [rt.cpan.org #61299] apostrophe issue
Date: Fri, 17 Sep 2010 13:53:43 +0400
To: bug-Spreadsheet-ParseExcel [...] rt.cpan.org
From: Pavel Goloborodko <mailgpa [...] gmail.com>
Download (untitled) / with headers
text/plain 510b
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
> <URL: https://rt.cpan.org/Ticket/Display.html?id=61299 > > > Hi, > > There is a fix for this in the repo on Github. > > http://github.com/jmcnamara/spreadsheet-parseexcel > > Can you try it out and let me know if it resolves the issue. > > John. > -- > >
-- С уважением, / Kind regards, Павел Голобородько / Pavel Goloborodko
Fixed in Spreadsheet::ParseExcel version 0.58. Thanks, John. --
Subject: Re: [rt.cpan.org #61299] apostrophe issue
Date: Tue, 21 Sep 2010 12:51:16 +0400
To: bug-Spreadsheet-ParseExcel [...] rt.cpan.org
From: Pavel Goloborodko <mailgpa [...] gmail.com>
Download (untitled) / with headers
text/plain 360b
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
> <URL: https://rt.cpan.org/Ticket/Display.html?id=61299 > > > Fixed in Spreadsheet::ParseExcel version 0.58. > > Thanks, > > John. > -- > >
-- С уважением, / Kind regards, Павел Голобородько / Pavel Goloborodko


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.