比对两个文件并纠错

#!/usr/bin/perl

use strict;
use warnings; ###############################################main################################
my %hash_txt = &read($ARGV[0]);my %hash_out = &read($ARGV[1]); foreach my $id (keys %hash_txt)
{
my $hash2 = $hash_txt{$id};
foreach my $title ( keys %$hash2)
{
if($hash2->{$title} == $hash_out{$id}{$title})
{
print "";
}
else
{
print $id."\t".$title."\t".$hash2->{$title}."\t".$hash_out{$id}{$title}."\n";
}
}
} ########################################sub######################################
sub read
{
my %out; my $input = shift;open TXT, "$input"; my $id = <TXT>;$id =~ s/\R/\n/g;chomp($id);my @id_split = split(/\t/,$id); my $info; my %a; while($info = <TXT>)
{
$info =~ s/\R/\n/g;chomp($info);
my @info_split = split(/[\t\s]/,$info);
my $i =1;
while ($i<18)
{
$a{$info_split[0]}{$id_split[$i]} = $info_split[$i]; $i++;
}
}
return %a
}

最新文章

  1. ecshop不同样式文章页调用不同文章模板
  2. winform 记住密码功能
  3. 一般多项式曲线的最小二乘回归(Linear Regression)
  4. init.css
  5. 购物车catslider简单的多商品分类滑动
  6. Android——进度条ProgressBar
  7. QtSpim实现MIPS指令的编写
  8. Spring 异常 —— cvc-elt.1: Cannot find the declaration of element &#39;beans&#39;
  9. write_chip,read_chip
  10. Intellj新增maven项目骨架
  11. 使用Sqlite数据库存储数据
  12. mysqlbinlog详解
  13. linux文件夹介绍
  14. 将csv格式的文件数据导入mysql中
  15. JavaWeb学习总结(三)——Tomcat服务器学习和使用(二)(转)
  16. vue.js实战——props单向数据流
  17. iframe登录超时跳转登录页面
  18. query的set能添加多个
  19. Cpp读文件、CString转String、String转CString
  20. QAQ的LIS树 QAQ的LIS树2 题解报告

热门文章

  1. Ubuntu16.04 开机显示The system is running in low-graphics mode
  2. GCC在C语言中内嵌汇编 asm __volatile__
  3. Codeforces Round #422 (Div. 2) C. Hacker, pack your bags!(更新数组)
  4. hdoj5698
  5. python __builtins__ enumerate类 (21)
  6. 二分优化的lis
  7. 跟我一起玩Win32开发(6):创建右键菜单
  8. c++中的虚函数是什么东西?
  9. FZu Problem 2236 第十四个目标 (线段树 + dp)
  10. 构造 Bubble Cup 8 - Finals D. Tablecity