- 论坛徽章:
- 0
|
#!/usr/bin/perl -w
use strict;
use 5.010;
open my $IN_1 , '<' , "orange_in_1.file" or die "Can not read! $!\n";
open my $IN_2 , '<' , "orange_in_2.file" or die "Can not read! $!\n";
open my $OUT , '>' , "orange_out.file" or die "Can not write! $!\n";
my @a = <$IN_1>;
my @b = <$IN_2>;
my $line_b = @b;
my $count_line_b = 0;
foreach (@a) {
chomp;
chomp ($b[$count_line_b]);
if (/\>/ && $count_line_b <= $line_b) {
print $OUT "$_\n";
$count_line_b++;
} else {
print $OUT "$_\n$b[$count_line_b]\n";
$count_line_b++;
}
}
close $IN_1;
close $IN_2;
close $OUT;
你试试吧,分别将两个文件的名字改下就行。 |
|