How to delete all but a certain pattern using sed
1
0
Entering edit mode
6.3 years ago
arsilan324 ▴ 90

How do I get just the link part in the http-source of a link?

I have

gene ORF%20Transcript_2%7Cg.4%20Transcript_2%7Cm.4%20type%3Ainternal%20len%3A102%20%28%2B%29

but I want,

gene Transript_2

I am using mac. Thanks for the help!

Arslan

sed bash • 1.0k views
ADD COMMENT
0
Entering edit mode
6.3 years ago
$ echo 'gene ORF%20Transcript_2%7Cg.4%20Transcript_2%7Cm.4%20type%3Ainternal%20len%3A102%20%28%2B%29' | sed 's/.*%20\(.*\)%7C.*/\1/'
Transcript_2
ADD COMMENT
0
Entering edit mode

Thank you for the reply! I forgot to mention that it is in the text file, how should i completely write the code mentioning file as well (juncus.tbl)?

ADD REPLY
0
Entering edit mode

, how should i completely write the code mentioning file as well

it's a very basic question, learn linux, read the sed manual.

ADD REPLY
0
Entering edit mode

I do understand your point but I am actually not a bioinformatics person! If you will just explain, it would be easier for me to go to next step which is crucial.

ADD REPLY
1
Entering edit mode

Okay! i got it..thanks

ADD REPLY
1
Entering edit mode

I am actually not a bioinformatics person

sorry i didn't want to be picky. There are a lot of students who ask to do their jobs.

ADD REPLY

Login before adding your answer.

Traffic: 1511 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