Off topic:Removing text after pattern using sed
0
0
Entering edit mode
5.7 years ago
T_18 ▴ 50

Dear all,

I am just new in the world of sed.. Simple question, but struggling now for quit a while with this:

I have a list of gene names:

CYP6k1
CYP4L15
CYP354A5
CYP4d8
CYP354A5
CYP354A14
CYP4c1
CYP354A5
CYP4V2
CYP354A5

I only want to keep "CYP" and the number, so: CYP6, CYP4 etc. I tried to use sed as follows (closest I could get):

sed -E 's/[A-Z]{3}[0-9]+//'

But this is removing exactly the bit that I want to keep and I cannot use 'verbose' in combinaton with sed.

Any help is much appreciated! Thanks!

sed unix • 3.3k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 3225 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