If you should afterall be interested in Spreadsheet::ParseExcel, then maybe the following code from the docs (after naming the variables with slightly better readable names) is going to help you
use strict;
use Spreadsheet::ParseExcel;
my $BookObject = Spreadsheet::ParseExcel::Workbook->Parse('Excel/Test9
+7.xls');
foreach my $WorksheetObject (@{$BookObject->{Worksheet}}) {
print "--------- SHEET:", $WorksheetObject->{Name}, "\n";
for(my $RowIndex = $WorksheetObject->{MinRow}; # starting at minimu
+m row value
defined $WorksheetObject->{MaxRow} &&
$RowIndex <= $WorksheetObject->{MaxRow}; # ending at maximum
+row value
$RowIndex++) {
for (my $ColumnIndex = $WorksheetObject->{MinCol};
defined $WorksheetObject->{MaxCol} &&
$ColumnIndex <= $WorksheetObject->{MaxCol};
$ColumnIndex++) {
$CellObject = $WorksheetObject->{Cells}[$RowIndex][$ColumnIn
+dex]; # get cell
print "( $RowIndex , $ColumnIndex ) =>",
$CellObject->Value, "\n" # print cell contents ...
if ($CellObject); # ... if cell exists
}
}
}
Overview over the Spreadsheet::ParseExcell class:
class Spreadsheet::ParseExcel
| via ->Parse
class Spreadsheet::ParseExcel::Workbook
| via ->{Worksheet}
class Spreadsheet::ParseExcel::Worksheet
| via ->{Cells}[$Row][$Column]
class Spreadsheet::ParseExcel::Cell
And as well, but not so important:
class Spreadsheet::ParseExcel::Format
class Spreadsheet::ParseExcel::Font
class Spreadsheet::ParseExcel::Fmt
Hope this helped.
CombatSquirrel.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.