Removing text after pattern using sed
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!
• 3,486 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hello T_18!
We believe that this post does not fit the main topic of this site.
Purely unix question. Please Google/search StackOverflow
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!
After running above command, you may need to
sortand do auniq@ T_18