Perl解析Execl模块安装

前端之家收集整理的这篇文章主要介绍了Perl解析Execl模块安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Spreadsheet::ParseExcel 模块


模块下载地址:

    http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.59/lib/Spreadsheet/ParseExcel.pm


缺什么模块下载什么模块,安装什么模块,CPAN太强大了

Request modules:
   1、 OLE::Storage_Lite
        http://search.cpan.org/~jmcnamara/OLE-Storage_Lite-0.19/lib/OLE/Storage_Lite.pm
        $ perl Makefile.PL
        $ make
        $ make test
        $ sudo make install
        $ make clean


  2、Spreadsheet::WriteExcel
        http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.40/lib/Spreadsheet/WriteExcel.pm
        $ perl Makefile.PL
        $ make
        $ make test
        $ sudo make install
        $ make clean
        1).Parse::RecDescent     
                http://search.cpan.org/~jtbraun/Parse-RecDescent-1.967009/lib/Parse/RecDescent.pm
                $ perl Makefile.PL
                $ make
                $ make test
                $ sudo make install
                $ make clean
                
 3、Crypt/RC4.pm
        http://search.cpan.org/~sifukurt/Crypt-RC4-2.02/RC4.pm
                $ perl Makefile.PL
                $ make
                $ make test
                $ sudo make install
                $ make clean

4、Digest/Perl/MD5.pm
       http://search.cpan.org/~delta/Digest-Perl-MD5-1.9/
    ​    ​    ​    ​$ perl Makefile.PL
                $ make
                $ make test
                $ sudo make install
                $ make clean


example:

------------------------------------------------------------------------------------------------------

#!/usr/bin/perl -w use strict; use Spreadsheet::ParseExcel; my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse('a.xls'); if(!defined $workbook) {     die $parser->error()," .\n"; } for my $worksheet ($workbook->worksheets()) {     my ($row_min,$row_max) = $worksheet->row_range();     my ($col_min,$col_max) = $worksheet->col_range();     for my $row ($row_min .. $row_max) {         for my $col ($col_min .. $col_max) {             my $cell = $worksheet->get_cell($row,$col);             next unless $cell;             print "Row,Col    = ($row,$col)\n";             print "Value       = " .  $cell->value() .  "\n";             print "Unformatted =  " . $cell->unformatted() . "\n";             print "\n";         }     } }

猜你在找的Perl相关文章