Hi,
I am using the sed command for search and substitute but now i have a problem here.
Normally, i do:
sed s/ForThis/NewThis/g filename.txt
This will search
ForThis and replace it with NewThis in file filename.txt
Now, I want to do the same thing but substitution should happen on 2 lines as:
ForThis and replace it with NewThis1 and NewThis2 in file filename.txt as below:
NewThis1
NewThis2
If i want on same line, no problems. But i have to get these on 2 separate lines one after the other. Can someone help. I tried with \n but its not taking
sed s!"ForThis"!"NewThis1\nNewThis2"! filename.txt
Regards Ambrish