check.pl
2024-09-30 06:59:17
比对两个文件并纠错
#!/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
}
最新文章
- ecshop不同样式文章页调用不同文章模板
- winform 记住密码功能
- 一般多项式曲线的最小二乘回归(Linear Regression)
- init.css
- 购物车catslider简单的多商品分类滑动
- Android——进度条ProgressBar
- QtSpim实现MIPS指令的编写
- Spring 异常 —— cvc-elt.1: Cannot find the declaration of element &#39;beans&#39;
- write_chip,read_chip
- Intellj新增maven项目骨架
- 使用Sqlite数据库存储数据
- mysqlbinlog详解
- linux文件夹介绍
- 将csv格式的文件数据导入mysql中
- JavaWeb学习总结(三)——Tomcat服务器学习和使用(二)(转)
- vue.js实战——props单向数据流
- iframe登录超时跳转登录页面
- query的set能添加多个
- Cpp读文件、CString转String、String转CString
- QAQ的LIS树 QAQ的LIS树2 题解报告
热门文章
- Ubuntu16.04 开机显示The system is running in low-graphics mode
- GCC在C语言中内嵌汇编 asm __volatile__
- Codeforces Round #422 (Div. 2) C. Hacker, pack your bags!(更新数组)
- hdoj5698
- python __builtins__ enumerate类 (21)
- 二分优化的lis
- 跟我一起玩Win32开发(6):创建右键菜单
- c++中的虚函数是什么东西?
- FZu Problem 2236 第十四个目标 (线段树 + dp)
- 构造 Bubble Cup 8 - Finals D. Tablecity