Skip Menu |

This queue is for tickets about the Spreadsheet-XLSX CPAN distribution.

Report information
The Basics
Id: 70341
Status: new
Priority: 0/
Queue: Spreadsheet-XLSX

People
Owner: Nobody in particular
Requestors: msmoot [...] infoplanning.com
Cc:
AdminCc:

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



Subject: bug in Spreadsheet-XLSX-0.13
Date: Thu, 18 Aug 2011 11:15:22 -0400
To: "bug-Spreadsheet-XLSX [...] rt.cpan.org" <bug-Spreadsheet-XLSX [...] rt.cpan.org>
From: Martin Smoot <msmoot [...] infoplanning.com>
version: Spreadsheet-XLSX-0.13 perl -v: v5.12.2 Linux 2.6.18-194.17.1.el5PAE #1 SMP Wed Sep 29 13:31:51 EDT 2010 i686 i686 i386 GNU/Linux Problem: extracting a spreadsheet (in our case to a .csv) which goes beyond column ZZ causes all data that would be found beyond column ZZ (column AAA for example) to be put into column ZZ as it processes the spreadsheet so whatever is in the last column after ZZ will be put into ZZ. I do not have a fix but have determined that the following block of code around line 160 in XLSX.pm appears to be the source of the problem: if (/^\<c r=\"([A-Z])([A-Z]?)(\d+)\"/) { $col = ord ($1) - 65; if ($2) { $col++; $col *= 26; $col += (ord ($2) - 65); } $row = $3 - 1; $s = m/t=\"s\"/ ? 1 : 0; $s2 = m/t=\"str\"/ ? 1 : 0; $sty = m/s="([0-9]+)"/ ? $1 : 0; the value of $col never changes when we go past column ZZ and remains 701. I am attaching a sample spreadsheet that causes the problem and the .csv file that was created from the spreadsheet data using a perl based xlsx to csv conversion tool we have - here is the code used to write the data: sub excel_process($) { my($iR, $iC, $oWkS, $oWkC); my ($oBook)=@_; # Output the specified sheet for (my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) { $oWkS = $oBook->{Worksheet}[$iSheet]; for (my $iR = 0; ## was: $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) { $oWkC = $oWkS->{Cells}[$iR][$iC]; if ($oWkC) { my $Val=$oWkC->Value; $Val=~ s/,//; # eliminate embedded commas $Val=~ s/\n/ /g; # change embedded line terminators to spaces print $Val; } print ","; # this is the only comma we typically want } print "\n"; } } } This message is private and confidential. If you have received this message in error, please notify us by replying to this email and then delete it from your system. Thank you for your cooperation. Information Planning & Management Service, Inc.
Download demoss.xlsx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 75.7k

Message body not shown because it is not plain text.

Download newcsv.csv
application/octet-stream 27.8k

Message body not shown because it is not plain text.

Subject: RE: [rt.cpan.org #70341] AutoReply: bug in Spreadsheet-XLSX-0.13
Date: Thu, 18 Aug 2011 12:39:24 -0400
To: "bug-Spreadsheet-XLSX [...] rt.cpan.org" <bug-Spreadsheet-XLSX [...] rt.cpan.org>
From: Martin Smoot <msmoot [...] infoplanning.com>
I have a modified version of the XLSX.pm file attached to this message (with a different name) - please note that I have extra prints commented out in this code. this appears to solve the problem that I reported but I have only run the test on a single spreadsheet at this time. my test was to build a spreadsheet using the attached test program "makess.pl" where I just directed the output to a .csv file. I then used Excel to read the .csv and write the .xlsx file. I then used the .xlsx to .xsv conversion code to write a new .csv file and compared the data. I am going to run some more tests to verify that the code works as expected using other utilities (including a .csv to .xlsx utility). I will send an additional report if I find any other issues. Show quoted text
-----Original Message----- From: Bugs in Spreadsheet-XLSX via RT [mailto:bug-Spreadsheet-XLSX@rt.cpan.org] Sent: Thursday, August 18, 2011 11:13 AM To: Martin Smoot Subject: [rt.cpan.org #70341] AutoReply: bug in Spreadsheet-XLSX-0.13 Greetings, This message has been automatically generated in response to the creation of a trouble ticket regarding: "bug in Spreadsheet-XLSX-0.13", 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 #70341]. Your ticket is accessible on the web at: https://rt.cpan.org/Ticket/Display.html?id=70341 Please include the string: [rt.cpan.org #70341] in the subject line of all future correspondence about this issue. To do so, you may reply to this message. Thank you, bug-Spreadsheet-XLSX@rt.cpan.org ------------------------------------------------------------------------- version: Spreadsheet-XLSX-0.13 perl -v: v5.12.2 Linux 2.6.18-194.17.1.el5PAE #1 SMP Wed Sep 29 13:31:51 EDT 2010 i686 i686 i386 GNU/Linux Problem: extracting a spreadsheet (in our case to a .csv) which goes beyond column ZZ causes all data that would be found beyond column ZZ (column AAA for example) to be put into column ZZ as it processes the spreadsheet so whatever is in the last column after ZZ will be put into ZZ. I do not have a fix but have determined that the following block of code around line 160 in XLSX.pm appears to be the source of the problem: if (/^\<c r=\"([A-Z])([A-Z]?)(\d+)\"/) { $col = ord ($1) - 65; if ($2) { $col++; $col *= 26; $col += (ord ($2) - 65); } $row = $3 - 1; $s = m/t=\"s\"/ ? 1 : 0; $s2 = m/t=\"str\"/ ? 1 : 0; $sty = m/s="([0-9]+)"/ ? $1 : 0; the value of $col never changes when we go past column ZZ and remains 701. I am attaching a sample spreadsheet that causes the problem and the .csv file that was created from the spreadsheet data using a perl based xlsx to csv conversion tool we have - here is the code used to write the data: sub excel_process($) { my($iR, $iC, $oWkS, $oWkC); my ($oBook)=@_; # Output the specified sheet for (my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) { $oWkS = $oBook->{Worksheet}[$iSheet]; for (my $iR = 0; ## was: $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) { $oWkC = $oWkS->{Cells}[$iR][$iC]; if ($oWkC) { my $Val=$oWkC->Value; $Val=~ s/,//; # eliminate embedded commas $Val=~ s/\n/ /g; # change embedded line terminators to spaces print $Val; } print ","; # this is the only comma we typically want } print "\n"; } } } This message is private and confidential. If you have received this message in error, please notify us by replying to this email and then delete it from your system. Thank you for your cooperation. Information Planning & Management Service, Inc. This message is private and confidential. If you have received this message in error, please notify us by replying to this email and then delete it from your system. Thank you for your cooperation. Information Planning & Management Service, Inc.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.