Proper sed format to remove and of line characters?
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.
• 1,925 views
•
link
1 answer
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
• 1 views
•
link
Log in to answer this question.
Hello,
try to use
'instead of".fin swimmer
Thanks finswimmer.
Sadly, that didn't seem to solve the problem.
Hello stacy734 ,
please use the
ADD REPLYbutton below the post you like to reply to.Could you please:
?
Thanks!
fin swimmer
Show us an example of a fasta sequence with what you want to remove