Chinaunix首页 | 论坛 | 博客
  • 博客访问: 79670
  • 博文数量: 36
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 0
  • 用 户 组: 普通用户
  • 注册时间: 2016-07-28 10:06
个人简介

安徽屯溪,哈尔滨的雪地,扬州的瘦西湖,想必知道我是谁了吧!!对,小金思密达

文章分类

全部博文(36)

文章存档

2015年(7)

2014年(29)

我的朋友

分类: PERL

2015-11-26 20:39:03

#!/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";
}
阅读(964) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~