cat file.txt | perl -ne '...' > fastafile.fa