bash and awk code
1
0
Entering edit mode
7.0 years ago
Sam ▴ 150

Hello, how I can add organism name to miRNA name?

Thanks

Organism: aau,mir162,ATAAACCTCTGCATCCAG,N/A,28,22,2.19,1.82
convert to:

Organism: aau,aau-mir162,ATAAACCTCTGCATCCAG,N/A,28,22,2.19,1.82
awk bash • 1.3k views
ADD COMMENT
0
Entering edit mode

Is that all you need to do? Add aau to the second field?

Will the fields change in content?

ADD REPLY
0
Entering edit mode

Is the organism name constant (aau)?

ADD REPLY
0
Entering edit mode

yes , I need to add organism name to second file but organism name is NOT constant.

ADD REPLY
1
Entering edit mode
7.0 years ago
 sed 's/Organism\: \([^,]*\),/Organism: \1,\1-/' input

e.g:

$ echo 'Organism: aau,mir162' | sed 's/Organism\: \([^,]*\),/Organism: \1,\1-/'
Organism: aau,aau-mir162
ADD COMMENT

Login before adding your answer.

Traffic: 1943 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6