安装Perl Excel读取模块

在Win7上,进入VisualStudio2008的cmd line prompt

perl -MCPAN -e shell

install Spreadsheet::ParseExcel

install Spreadsheet::ParseExcel::FmtUnicode

install Unicode::Map

 

 

不过安装Win32::GUI失败,编译问题

 

参考Perl Excel读取

http://www.cnblogs.com/pangxiaodong/archive/2012/01/30/2331887.html

http://blog.chinaunix.net/uid-34002-id-2131797.html

 

调试通过:

 

#!/usr/bin/perl -w

use strict;
use Spreadsheet::ParseExcel;

my $parser = Spreadsheet::ParseExcel->new();
my $workbook = $parser->parse('carrizo_Fillrate_cl1341425_MCBFM_ONECYCLE.xls');

if ( !defined $workbook ) {
die $parser->error(), ".\n";
}

for my $worksheet ( $workbook->worksheets() ) {

printf("Sheet: %s\n", $worksheet->{Name});
if( $worksheet->{Name} =~ /Fillrate/ )
{
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";
}
}
}
}

 

 

Row, Col = (600, 11)
Value = 10.23
Unformatted = 10.2332917150066

Row, Col = (600, 12)
Value = 10.02
Unformatted = 10.0205238183467

Row, Col = (600, 13)
Value = 2.12%
Unformatted = 0.0212332110094224

Row, Col = (601, 0)
Value = fillrate_texture6_c64_rw_s8d24comp_rw_aa8
Unformatted = fillrate_texture6_c64_rw_s8d24comp_rw_aa8

Sheet: Interfaces_DB
Sheet: Interfaces_TCP
Sheet: MemCtrl
Sheet: CB
Sheet: DB
Sheet: TCPTCC
Sheet: Theoretical
Sheet: Peak Rates
Sheet: Compare
Sheet: EnginePerfHistory
Sheet: Chip_CONF
Sheet: Macros
Sheet: Chip_CONF old

D:\depot\PPV\project\GfxPV_DB\db_script>perl upload_excel.pl

转载于:https://www.cnblogs.com/kylegui/p/3791454.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值