Is there a way to split single .txt file with multiple fasta sequences into individual sequences in separate files
1
3
Entering edit mode
7.6 years ago
Alpha ▴ 30

Hi there!

Can anyone help in answering how to split single .txt file with multiple fasta sequences into multiple files containing each of the fasta sequence?

Thank you for your time and help!

sequence • 3.9k views
ADD COMMENT
7
Entering edit mode
7.6 years ago

using awk

awk '/^>/ {if(x>0) close(outname); x++; outname=sprintf("_%d.fa",x); print > outname;next;} {if(x>0) print >> outname;}' *.fasta
ADD COMMENT
0
Entering edit mode

Thanks alot Pierre for the help....

ADD REPLY

Login before adding your answer.

Traffic: 1835 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6