in reply to Re^3: XLSX read and dump
in thread XLSX read and dump
The test.xlsx file isn't in a zip file. I thought it was going to create a new file called test.xlsx, but didn't. So then I tried renaming one of the files to test.xlsx and placed it in the same directory as the script below, named parse.pl, thinking that it would read it. Either way, I still get the same error about a zip archive.
use strict; use warnings; use Spreadsheet::XLSX; my $excel = Spreadsheet::XLSX -> new ('test.xlsx'); foreach my $sheet (@{$excel -> {Worksheet}}) { printf("Sheet: %s\n", $sheet->{Sheet1}); $sheet -> {B45} ||= $sheet -> {B37}; foreach my $row ($sheet -> {B37} .. $sheet -> {B45}) { $sheet -> {R45} ||= $sheet -> {C45}; foreach my $col ($sheet -> {C45} .. $sheet -> {R45}) +{ my $cell = $sheet -> {Cells} [$row] [$col]; if ($cell) { printf("( %s , %s ) => %s\n", $row, $col, +$cell -> {Val}); } } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: XLSX read and dump
by toolic (Bishop) on Jan 18, 2012 at 19:07 UTC | |
by chirp84 (Novice) on Jan 18, 2012 at 19:17 UTC | |
Re^5: XLSX read and dump
by runrig (Abbot) on Jan 18, 2012 at 20:36 UTC | |
by chirp84 (Novice) on Jan 18, 2012 at 21:02 UTC | |
Re^5: XLSX read and dump
by talexb (Chancellor) on Jan 18, 2012 at 19:48 UTC | |
by tobyink (Canon) on Jan 18, 2012 at 21:30 UTC | |
by chirp84 (Novice) on Jan 18, 2012 at 20:11 UTC | |
by talexb (Chancellor) on Jan 18, 2012 at 20:28 UTC |
In Section
Seekers of Perl Wisdom