View Single Post
Old 07-03-2013, 03:32 PM   #1
Giorgio C
Member
 
Location: ITALY

Join Date: Oct 2010
Posts: 89
Default Add count numbers to headers in a fasta file

Hi all,

I have a fasta file with the same header for each sequence, I would like to add natural numbers at the end of each line:

>OakDna
ACTCTAAATCAGTGCGAG...
>OakDna
AAAAACCCTTTACACTTT...
>OakDna
CTCTAAACCTTTAACCTT..
etc.

I want something like this:

>OakDna_1
ACTCTAAATCAGTGCGAG...
>OakDna_2
AAAAACCCTTTACACTTT...
>OakDna_3
CTCTAAACCTTTAACCTT..
etc.
>OakDna_n
ACTCATCCAAAACTTTTT..

Where n is the last number of the sequence in the file.

Any quick suggestion?

Thanks in advance,
Giorgio
Giorgio C is offline   Reply With Quote