$ cat merge_925829.pl
#!/usr/bin/perl
use strict;
use warnings;
use Spreadsheet::ParseExcel;
my $p = Spreadsheet::ParseExcel->new();
my $WB = $p->parse('merge_925829.xls');
if (!defined $WB) {
die $p->error(), ".\n";
}
for my $WS ($WB->worksheets()) {
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 );
next unless $cell;
print "Row, Col = ($row, $col)\n";
print "Value = ", $cell->value(), "\n";
print "Unformatted = ", $cell->unformatted(), "\n";
print "\n";
}
}
}
$ ./merge_925829.pl
Row, Col = (0, 0)
Value = a1/b1
Unformatted = a1/b1
Row, Col = (0, 1)
Value =
Unformatted =
Row, Col = (0, 2)
Value = c1
Unformatted = c1
Row, Col = (1, 0)
Value = a2
Unformatted = a2
Row, Col = (1, 1)
Value = b2/c2
Unformatted = b2/c2
Row, Col = (1, 2)
Value =
Unformatted =
Row, Col = (2, 0)
Value = a3/b3/c3
Unformatted = a3/b3/c3
Row, Col = (2, 1)
Value =
Unformatted =
Row, Col = (2, 2)
Value =
Unformatted =
Row, Col = (3, 0)
Value = a4
Unformatted = a4
Row, Col = (3, 1)
Value = b4
Unformatted = b4
Row, Col = (3, 2)
Value = c4
Unformatted = c4
Perhaps you ought to provide a little more detail with your question so you can get a more useful response...
...roboticus
When your only tool is a hammer, all problems look like your thumb. |