From the docs:
@sheets = $xls->sheets;
Each spreadsheet can contain one or more worksheets. This fetches them all back. You can then iterate over them, or jump straight to the one you wish to play with.
So, to get, for example, the 3rd worksheet you can do something like
$thirdsheet = ($xls->sheets)[3];
In your example, you
are getting the 6th column, which consists of the 6th element in each single row.
As far as I see it, the only way to get a specific row, is in an empty for-loop:
for (1..5) { # skip first five rows
$sheet->has_data or die "Can't get 5th row: Too few rows\n";
$sheet->next_row;
}
my @data = $sheet->next_row;
Hope this helps (and works - this computer doesn't have Excel installed, so it's untested).
Addendum: You might be interested in the
Spreadsheet::ParseExcel module, which has a broader variety of commands. Specifically, you can get the contents of single cells from a worksheet.
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.