Question: Proper sed format to remove and of line characters?
0
gravatar for stacy734
9 months ago by
stacy73440
stacy73440 wrote:

Hi everyone,

I have a fasta file with some junk at the end of many lines, which I would like to remove using sed.

I have tried these formats, but am getting errors inre illegal variable names:

sed -e "s/NNG$//g"

sed -e "s/NNG\$//g"

sed -e "s/NNG$//g"

sed -e "s/NNG+$//g"

sed -e "s/NNG*$//g"

I'm stumped. Any advice will be appreciated.

sed fasta • 322 views
ADD COMMENTlink modified 9 months ago by jcabraham0 • written 9 months ago by stacy73440
1

Hello,

try to use ' instead of ".

fin swimmer

ADD REPLYlink written 9 months ago by finswimmer12k

Thanks finswimmer.

Sadly, that didn't seem to solve the problem.

ADD REPLYlink written 9 months ago by stacy73440
1

Hello stacy734 ,

please use the ADD REPLY button below the post you like to reply to.

Could you please:

  • post an example of the input file
  • post the exact error message you receive
  • tell us what OS you are using
  • tell which shell (bash?, zsh?, ...) you are using

?

Thanks!

fin swimmer

ADD REPLYlink written 9 months ago by finswimmer12k

Show us an example of a fasta sequence with what you want to remove

ADD REPLYlink written 9 months ago by Joe14k
0
gravatar for jcabraham
9 months ago by
jcabraham0
jcabraham0 wrote:

You're matching , or "all of []" Try "." instead, or "match all occurences of [anything]":

sed -e 's/NNG.*$//'

# Input
goodNNGS
goodNNGS
goodNNGC
goodNNGA

# Output
good
good
good
good
ADD COMMENTlink written 9 months ago by jcabraham0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1831 users visited in the last hour