Try the following:
use strict; use warnings; my $i = 1; while (<>) { s/>\K.+/$i++/e; print; }
Output from your data:
>1 MNLTFDYTKEPSRDVLCIDVKSFYASVECVERG LDPLKTMLVVMSNSENSGGLVLAASPM >2 MKQNRKEFSSYFSRSIKQNKPLYLLLMSSETNPF PRPVIGTFRGYVEENKIIIGEDSYSI
Usage: perl script.pl inFile >outFile
As the fasta inFile is read line-by-line, the regex will substitute all past the > with the value of $i. The >outFile notation directs the printing to the file outFile.
Hope this helps!
In reply to Re: file header change
by Kenosis
in thread file header change
by utpalmtbi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |