in reply to Random sequence creator with range
perl -e '$file = "seq001"; for (@ARGV) { if (10 <= $_ && $_ <= 40) { r +ead STDIN, my $seq, $_; open my $FH, ">", $file++; print $FH $seq } } +' 10 18 28 < fasta.txt [download]