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";
        }
    }
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值