sed substitute command -- need help

I am trying to do what I thought should be a simple substitution, but I can't get it to work.

File:

Desire output:

I thought I'd start with a sed command to remove the part of the header line preceding the string "comp", then go on to remove the suffix of the target string (e.g. ":3-509(-)"), followed by an awk command to retain only lines beginning with "comp". But my sed command doesn't do anything and I'm not sure why, so I'm stuck.

sed -e 's/\>.+_comp/_comp/'
awk '/>/{gsub(/.*\)_|:.*/,x); print}' file
1 Like

Try:

sed -n '/^>/s/.*)_//;s/:.*//p'
1 Like

Both of these work, thanks!