Entering edit mode
2.6 years ago
sunnykevin97
▴
990
Hi
I have thousands(1000's) of fasta files in one directory, I want to replace all the fasta file headers with the same keyword >Gast_superba ??
suggestions.
cpad0112, thanks I solved it by writing loop.
Do you want to add
Gast_superba
in to the description line of the entries following the caret in each one and leave the rest of the previous description line? A few examples of what you have and what you want for each entry in the file would make sure you got the best advice. Because I wonder if I have it backwards, and you want to replace all those occurences with something different, similar to here.This sounds like the fastest way to do this would be to use a shell script to iterate on the FASTA files matching your extension, see here, and then use
sed
to the a find/replace on the header line, see here. If I understand correctly you replace every caret with>Gast_superba
.There's a lot of similar answers already in Biostars if you look around.
Replacing the header name of each fasta file (10000's) in a directory, I solved it writting a loop.
Original file
Modified file