Chinaunix首页 | 论坛 | 博客
  • 博客访问: 21774
  • 博文数量: 5
  • 博客积分: 1512
  • 博客等级: 上尉
  • 技术积分: 75
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-23 23:18
文章分类

全部博文(5)

文章存档

2011年(4)

2008年(1)

我的朋友

分类:

2008-11-30 23:32:50

use strict;
use Spreadsheet::ParseExcel;
die "You must provide a filename to $0 to be parsed as an Excel file" unless @ARGV==1;
my $file=shift;
my %count;
my $excel = Spreadsheet::ParseExcel::Workbook->Parse($file);
foreach my $sheet (@{$excel->{Worksheet}}) {
 printf("Sheet: %s\n", $sheet->{Name});
 foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow}) {
   my $cell = $sheet->{Cells}[$row][1];
   if ($cell) {
    $count{$cell}++;
    printf("( %s , %s ) => %s\n", $row, 1, $cell->{Val});
   }
 }
}
for my $n(sort keys %count)
{ print "".$n."\t".$count{$_}."\n"; }
阅读(684) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:自动修改并创建配置文件中指定的路径

给主人留下些什么吧!~~