How to delete part of row names in a list in linux
2
0
Entering edit mode
14 months ago

I have a list of names. I want to delete part of the names and keep only the last part. Can someone help me with a script in Linux or in R?

List I have

sp|Q9LQM8|M2K10_ARATH
sp|Q1PE17|CDPKI_ARATH
sp|Q0D715|CDPKI_ORYSJ
sp|Q9SND6|M3K20_ARATH

I want to have

M2K10_ARATH
CDPKI_ARATH
CDPKI_ORYSJ
M3K20_ARATH
Linux • 954 views
ADD COMMENT
1
Entering edit mode

What have you tried? This is basic string manipulation and is almost off topic on the site.

ADD REPLY
0
Entering edit mode
14 months ago
darklings ▴ 580

try cat your.file | cut -d"|" -f3

ADD COMMENT

Login before adding your answer.

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