This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Change of file name

I have a blast output named as

NP_001034280.2  XP_018570607.1.

However, i want to convert this as

TC_001034280.2    AGLA_018570607.1.

How i could do this?

I was trying this one

awk 'NR==1 {gsub("\\NP", "TC", $0); quit};1' file.txt

However, i it did not work.

sequence gene

1 answer

awk 'NR==1 { gsub(/NP/, "TC"); }' file.txt

Log in to answer this question.