I have an input file that looks like this:
>Seq_1;1
AAAAAAAAAAAAAAAAAAAAA
>Seq_2;1
CCCCCCCCCCCCCCCCCCCCC
And there are many more pairwise line like that. What I want to do is to simply print it out like this:
>Seq_1;1 AAAAAAAAAAAAAAAAAAAAA
>Seq_2;1 CCCCCCCCCCCCCCCCCCCCC
But why this code fail:
#!/usr/bin/perl -w
while ( <> ) {
chomp;
my $line = $_;
my $rdn = "";
my $sq = "";
if ( $line =~ /^>/ ) {
$rdn = $line;
}
elsif ($line =~ /^[ATCG]/) {
$sq = $line;
}
print "$rdn $sq\n";
}
It print this instead:
>Seq_1;1
AAAAAAAAAAAAAAAAAAAAA
>Seq_2;1
CCCCCCCCCCCCCCCCCCCCC
xargs -n 2 < file.fa