Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created July 9, 2012 10:30
Show Gist options
  • Save ynonp/3075658 to your computer and use it in GitHub Desktop.
Save ynonp/3075658 to your computer and use it in GitHub Desktop.
use v5.14;
use Spreadsheet::ParseExcel;
use strict;
use warnings;
use Data::Printer;
my $parser = Spreadsheet::ParseExcel->new;
my $workbook = $parser->parse( 'demo1.xls' ) or die $parser->error;
my $ws = $workbook->worksheet(0);
my ( $row_min, $row_max ) = $ws->row_range;
my ( $col_min, $col_max ) = $ws->col_range;
for my $row ( $row_min .. $row_max ) {
for my $col ( $col_min .. $col_max ) {
my $cell = $ws->get_cell( $row, $col );
say "($row, $col) = ", $cell->value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment