Spreadsheet::ParseExcel - Get information from Excel file
use strict; use Spreadsheet::ParseExcel; my $oExcel = new Spreadsheet::ParseExcel; #1.1 Normal Excel97 my $oBook = $oExcel->Parse('Excel/Test97.xls'); my($iR, $iC, $oWkS, $oWkC); print "FILE :", $oBook->{File} , "\n"; print "COUNT :", $oBook->{SheetCount} , "\n"; print "AUTHOR:", $oBook->{Author} , "\n"; for(my $iSheet=0; $iSheet < $oBook->{SheetCount} ; $iSheet++) { $oWkS = $oBook->{Worksheet}[$iSheet]; print "--------- SHEET:", $oWkS->{Name}, "\n"; for(my $iR = $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) { for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) { $oWkC = $oWkS->{Cells}[$iR][$iC]; print "( $iR , $iC ) =>", $oWkC->Value, "\n"; } } }
Spreadsheet::ParseExcel makes you to get information from Excel95, Excel97, Excel2000 file.
$oExcel = new Spreadsheet::ParseExcel;
Constructor.
If you don't want to use OLE::Storage, you can use like this:
$oExcel = new Spreadsheet::ParseExcel(NotUseOLE=>1);
But this works imcompletely!
$oWorkbook = $oParse->Parse(oFileName [, $oFmt]);
return Workbook object. if error occurs, returns undef.
name of the file to parse
"Formatter Class" to format the value of cells.
Spreadsheet::ParseExcel::Workbook
Workbook class has these properties :
Name of the file
Author of the file
If this flag is on, date of the file count from 1904.
Version of the file
Numbers of Worksheet s in that Workbook
Array of Worksheets class
Spreadsheet::ParseExcel::Worksheet
Worksheet class has these properties:
Name of that Worksheet
Default height of rows
Default width of columns
Array of row height
Array of column width (undef means DefColWidth)
Array of Cells infomation in the worksheet
Spreadsheet::ParseExcel::Cell
Cell class has these properties:
Method Formatted value of that cell
Original Value of that cell
Kind of that cell ('Text', 'Numeric', 'Date')
Character code of that cell (undef, 'ucs2', '_native_') undef tells that cell seems to be ascii. '_native_' tells that cell seems to be 'sjis' or something like that.
Spreadsheet::ParseExcel::Fmt*
Formatter class will convert cell data.
Spreadsheet::ParseExcel includes 2 formatter classes: FmtDefault and FmtJapanese. You can create your own FmtClass as you like.
Formatter class(Spreadsheet::ParseExcel::Fmt*) should provide these functions:
tells type of the cell that has specified value.
Formatter itself
If on, the value seems to be number
Format index number of that cell
converts original text into applicatable for Value.
Original text
Character code of Original text
converts original value into applicatable for Value.
Cell object
Workbook object
Kawai Takanori (Hippo2000) GCD00051@nifty.ne.jp
http://member.nifty.ne.jp/hippo2000/ (Sorry Only in Japanese)
XLHTML, OLE::Storage, Spreadsheet::WriteExcel
This module is based on herbert within OLE::Storage and XLHTML.
The Spreadsheet::ParseExcel module is Copyright (c) 2000 Kawai Takanori. Japan. All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
First of all, I would like to acknowledge valuable program and modules : XHTML, OLE::Storage and Spreadsheet::WriteExcel.
In no particular order: Simamoto Takesi, Noguchi Harumi, Ikezawa Kazuhiro, Suwazono Shugo, Hirofumi Morisada, Michael Edwards, Kim Namusk and many many people + Kawai Mikako.
To install Spreadsheet::ParseExcel::Workbook, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Spreadsheet::ParseExcel::Workbook
CPAN shell
perl -MCPAN -e shell install Spreadsheet::ParseExcel::Workbook
For more information on module installation, please visit the detailed CPAN module installation guide.