  
- 帖子
- 3167
- 积分
- 6481
- 技术
- 320
- 捐助
- 70
- 注册时间
- 2008-8-3
|
本帖最后由 523066680 于 2016-9-2 20:59 编辑
没有缩进,差评!
也写了一个
- open $RA, "<:raw", "jd.txt";
- open $RB, "<:raw", "stem.txt";
- open $WRT, ">:raw", "out_jd.txt";
- my $line;
- my %hash;
- while ($line = <$RB>)
- {
- $line =~ /(.*?)\s+(\w+)/;
- $hash{$1} = $2;
- }
- while ($line = <$RA>)
- {
- $line =~ s/\r?\n$//;
- $line =~ /^(.*?)\s+/;
- print $WRT $line;
- print $WRT "\t".$hash{$1} if (exists $hash{$1});
- print $WRT "\r\n";
- }
- close $RA;
- close $RB;
- close $WRT;
|
|