#!/usr/bin/perl
#
open IN,'<','FILE';
open OUT,">Result";
while (){
chomp;
@arr = split(/\s+/,$_);
$title = shift @arr;
$num = pop @arr;
$other = join("\t",@arr);
if($hash{$title}){
if ($num > $hash{$title}){
$hash{$title}=$num;
$hash_tem{$title} =$other;
}
}else {
$hash{$title}=$num;
$hash_tem{$title} = $other;
}
}
foreach (keys %hash){
print OUT"$_\t$hash_tem{$_}\t$hash{$_}\n";
}
阅读(1002) | 评论(0) | 转发(0) |