Entering edit mode
21 months ago
Nelo
▴
20
Hi
I have a file T.fasta as:
>AAAA
GVNCLPQWERTYI
>BBBB
HJKSDRTYPALVNM
>CCCC
TRHJPKFLMVNCTEGH
and another file.txt with two columns: One column with header of the T.fasta file and a second column with the new name like:
CCCC C_pr3
BBBB B_pr2
AAAA A_pr1
Now I want to replace the header of T.fa with the second column of the second file if first column of second file match with the header of T.fa.
The deisred output should look like this:
>A_pr1
GVNCLPQWERTYI
>B_pr2
HJKSDRTYPALVNM
>C_pr3
TRHJPKFLMVNCTEGH
**My both file are not sorted accordingly.
duplicate : Rename fasta headers from CSV; replace fasta headers with another name in a text file ; ....