加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

利用perl对比两个文件,并对数据进行筛选,涉及到哈希的应用和pe

发布时间:2020-12-15 21:03:59 所属栏目:大数据 来源:网络整理
导读:my %scyjm;open (CONTACT,"f:perlf.txt")||die("can not open the file!"); while (CONTACT){next if /^#/;#if($_=~/^#/的简写chomp;my @information =split;# my @information=split/s+/,$_;的简写next if(($information[1]=~/./) ($information[2]=~





my %scyjm;
open (CONTACT,"f:perlf.txt")||die("can not open the file!"); 
while (<CONTACT>)
{
	next if /^#/;#if($_=~/^#/的简写
	chomp;
	my @information =split;# my @information=split/s+/,$_;的简写
	next if(($information[1]=~/./) && ($information[2]=~/./));
	$scyjm{$information[13]}->{$information[0]}=$information[3];
}
close CONTACT;
open (SC,"f:perla.csv")||die("can not open the file!");
while(<SC>)
{
	chomp;
	my @sc=split;
	if ( $scyjm{$sc[1]}{$sc[2]})
	{
	    print "$sc[0] $sc[1] $sc[2] $sc[3] $sc[4] $sc[6] $yjm[6]n";
	}
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读