in reply to Re^2: combine 2 fasta files into 1
in thread combine 2 fasta files into 1

Ok form what I figure you have several lines in F1 and you what to skip the first corresponding line in F2.

use warnings; use strict; open( F1, "subsettest.txt" ) or die "file1: $!"; open( F2, "subsettest1.txt" ) or die "file2: $!"; my @s2s = (); while ( my $s1 = <F1> ) { my $s2 = <F2>; if ( $s1 =~ /^>/ ) { foreach (@s2s) {print $_;} print $s1; @s2s = (); } else { push (@s2s,$s2); print $s1; } } foreach (@s2s) {print $_;} close F1; close F2; exit;