ArifS has asked for the wisdom of the Perl Monks concerning the following question:
Outputuse strict; use warnings; use 5.010; use Spreadsheet::Read qw(ReadData); my $book = ReadData ('excel.xlsx'); my @rows = Spreadsheet::Read::rows($book->[1]); foreach my $i (1 .. scalar @rows) { foreach my $j (1 .. scalar @{$rows[$i-1]}) { say " $i " . " $j " . ($rows[$i-1][$j-1] // ''); } }
I am trying to print output for each row's with given column's-1 1 Row1Col1 1 2 Row1Col2 1 3 Row1Col3 1 4 Row1Col4 1 5 Row1Col5 2 1 Row2Col1 2 2 Row2Col2 2 3 Row2Col3 2 4 Row2Col4 2 5 Row2Col5
Do the same for other rows... Any suggestion?Row[i]1st: Row1Col1, Row[i]3rd: Row1Col3
for my $i (0..1) { print "$sheet->{Cells}[$i][0]{Val}"; $i++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse excel Rows for given column's
by Corion (Patriarch) on Jul 12, 2016 at 19:14 UTC | |
|
Re: Parse excel Rows for given column's
by haukex (Archbishop) on Jul 12, 2016 at 21:18 UTC |