divyahk has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I am a newbie to Perl and have a problem with parsing an Excel file. I am using Spreadsheet::XLSX for reading data from an Excel file and extract each row of data, one row at a time. The code (partial) is as follows:
use strict; use warnings; use Spreadsheet::Read; use Data::Dumper; my $excel = Spreadsheet::XLSX->new (‘xyz.xlsx'); if (!defined $excel) { die "Error: " . $excel->error() . "\n"; } print “Read with Spreadsheet::XSLX\n"; print Dumper($excel) . “\n";
The output here shows that it’s reading the correct workbook as it can recognise the correct worksheet called “Paper.1”, and I think I am using the correct version of the Excel parser as it is indeed the .xlsx variety of Excel. Why are the cells not being read then? (As shown by cells =>undef)
Read with Spreadsheet::XLSX : $VAR1 = bless( { 'Worksheet' => [ bless( { 'DefColWidth' => '8.43', 'MinCol' => 0, 'MaxRow' => 0, 'MinRow' => 0, 'path' => 'worksheets/sheet +1.xml', 'MaxCol' => 0, 'Name' => 'Paper.1', 'Cells' => undef }, 'Spreadsheet::ParseExcel:: +Worksheet' ) ], 'Flg1904' => 0, 'FmtClass' => bless( {}, 'Spreadsheet::XLSX::Fmt2007' + ), 'SheetCount' => 1 }, 'Spreadsheet::ParseExcel::Workbook' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Spreadsheet::XSLX parsing workbook, but not retrieving values from cells
by Tux (Canon) on Sep 17, 2014 at 12:38 UTC | |
|
Re: Spreadsheet::XLSX parsing workbook, but not retrieving values from cells
by Athanasius (Cardinal) on Sep 17, 2014 at 11:47 UTC | |
by divyahk (Initiate) on Sep 17, 2014 at 12:38 UTC | |
by Tux (Canon) on Sep 17, 2014 at 12:47 UTC | |
by divyahk (Initiate) on Sep 18, 2014 at 10:38 UTC | |
|
Re: Spreadsheet::XSLX parsing workbook, but not retrieving values from cells
by Anonymous Monk on Sep 17, 2014 at 11:27 UTC |