1754020 Members
7330 Online
108811 Solutions
New Discussion юеВ

sed question

 
SOLVED
Go to solution
Sharvil Desai
Frequent Advisor

sed question

Hi!
I have a text file and I want to add the word "SUM(" in the begining of every line. Can you please tell me how to accomplish this?

when I try the following command,
sed 's/^/^SUM(/g' view.txt


I keep getting the following error,
sed: no remembered regular expressionThank you!
"help!"
2 REPLIES 2
benoit Bruckert
Honored Contributor
Solution

Re: sed question

Can you try this :
sed 's/^/SUM(/g' view.txt
TO see if it's better ??
It works for me...

regards
Benoit
Une application mal pans├йe aboutit ├а une usine ├а gaze (GHG)
Sharvil Desai
Frequent Advisor

Re: sed question

Actually, I too had tried that before and it didn't work. However, I think the problem is that I am using sed from WINNT through MKS toolkit. I tried that command on HP-UX and it worked fine....but thanx for confirming my doubt.
"help!"