![]() |
|< 1 2 >| | ![]() |
16 Einträge, 2 Seiten |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/usr/bin/perl use strict; use warnings; use Spreadsheet::ParseExcel; my $xls = 'acc.xls'; exit unless -e $xls; my $parser = Spreadsheet::ParseExcel::Workbook->Parse( $xls ); my $sheet = $parser->{Worksheet}->[0]; $sheet->{MaxRow} ||= $sheet->{MinRow}; my %hash; for my $row ( $sheet->{MinRow} .. $sheet->{MaxRow} ){ my $acc = $sheet->{Cells}->[$row]->[1]; if( $acc and $acc->Value ne 'ACCNumber' ){ my $cell = $sheet->{Cells}->[$row]->[0]; push @{ $hash{ $acc->Value } }, $cell->Value; } } for my $key ( sort keys %hash ){ my $sum = 0; $sum += $_ for @{ $hash{$key} }; my $avg = $sum / scalar( @{ $hash{$key} } ); print "Acc: $key -> $avg\n"; }
![]() |
|< 1 2 >| | ![]() |
16 Einträge, 2 Seiten |