For example: I have a txt file like :
text("hello") text("world") text("once") text("again")
Aim to replace
hello with string_1,
world with string_2,
once with string_3,
again with string_4,
How to write the script?
feedback
|
the above command will do inplace replacement.if you want the ouput to console,then,
remove " another way is :
awk:
|
||||
feedback
|
A nice technique is to use a dictionary of replacement strings. Something like:
|
|||
feedback
|
grep
is not useful for this. Read up nosed
. – William Pursell Sep 18 '12 at 16:21