Question: Proper sed format to remove and of line characters?
0
gravatar for stacy734
20 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 • 490 views
ADD COMMENTlink modified 20 months ago by jcabraham0 • written 20 months ago by stacy73440
1

Hello,

try to use ' instead of ".

fin swimmer

ADD REPLYlink written 20 months ago by finswimmer13k

Thanks finswimmer.

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

ADD REPLYlink written 20 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 20 months ago by finswimmer13k

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

ADD REPLYlink written 20 months ago by Joe17k
0
gravatar for jcabraham
20 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 20 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: 1346 users visited in the last hour