Spreadsheet::ParseExcel::Simple - A simple interface to Excel data
my $xls = Spreadsheet::ParseExcel::Simple->read('spreadsheet.xls'); foreach my $sheet ($xls->sheets) { while ($sheet->has_data) { my @data = $sheet->next_row; } }
This provides an abstraction to the Spreadsheet::ParseExcel module for simple reading of values.
You simply loop over the sheets, and fetch rows to arrays.
For anything more complex, you probably want to use Spreadsheet::ParseExcel directly.
my $xls = Spreadsheet::ParseExcel::Simple->read('spreadsheet.xls');
This opens the spreadsheet specified for you. Returns undef if we cannot read the book.
@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.
if ($sheet->has_data) { ... }
This lets us know if there are more rows in this sheet that we haven't read yet. This allows us to differentiate between an empty row, and the end of the sheet.
my @data = $sheet->next_row;
Fetch the next row of data back.
Tony Bowden
Please direct all correspondence regarding this module to: bug-Spreadsheet-ParseExcel-Simple@rt.cpan.org
Copyright (C) 2001-2004 Tony Bowden. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Spreadsheet::ParseExcel.
To install Spreadsheet::ParseExcel::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Spreadsheet::ParseExcel::Simple
CPAN shell
perl -MCPAN -e shell install Spreadsheet::ParseExcel::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.