本帖最后由 949825667@qq.co 于 2016-9-2 21:34 编辑
无意中看到的,不知道算不算挖坟!
算是一种思路吧!效率还不错! | open($IN,'<jd.txt'); | | open($IN1,'<stem.txt'); | | open($OUT,'>out.txt'); | | while(<$IN1>){ | | ($C,$D)=split(/\s+/,$_); | | $dic1{$C}=$D; | | } | | while(<$IN>){ | | ($A,$B)=split(/\s+/,$_); | | if(exists $dic1{$A}){ | | print $OUT "$A $B $dic1{$A}\n"; | | }else{ | | print $OUT "$A $B\n"; | | }}COPY |
|