#!/usr/bin/perl
设log文件名为“test.txt”
open(F,"test.txt")or die "error";
$line=0;
while(<F>){
chomp;
if($line==0){$line=1;next;} #跳过第一行
@array=split /\|/;
$freq{$array[3]}++; #用户以qq号,累积每行交易次数
$amount{$array[3]}+=$array[7]; #累积该qq号的货币额度
}
close F;
foreach $temp (sort {$freq{$b}<=>$freq{a}} keys %freq) {#按交易次数排序
print $temp."\t".$amount{$temp}."\t".$freq{$temp}."\n";
}


雷达卡



京公网安备 11010802022788号







