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"; }
阅读(717) | 评论(0) | 转发(0) |