I want do a series of "search and replace" on a given file, say file.txt. For example,
s/foo/bar/g
s/abc/xyz/g
s/pqr/lmn/
g/string-delete/d
and so on.
How shuld I write all these actions in a script file and then run them on a single go on the target file.txt to save it to newfile.txt?
I saw this post Search and replace variables in a file using bash/sed but somehow couldn't get it to work for me.
Edit: i would prefer a vim/ed based solution Thanx tempora