ma466
May 28, 2009, 11:02am
1
Hi all experts,
I want to replace RORPELL_SYSTEM_REG_IND by this RORPELL_SYSTEM_REQ_IND. The script name is rorpelli_0713003.sql and it has thousands of RORPELL_SYSTEM_REQ_IND . How i can do the replacement. I did VI to rorpelli_0713003.sql and then press /.
-----Post Update-----
Please help
sed 's/RORPELL_SYSTEM_REG_IND/RORPELL_SYSTEM_REQ_IND/g' rorpelli_0713003.sql
vbe
May 28, 2009, 11:31am
3
in vi?
:%s/RORPELL_SYSTEM_REG_IND/RORPELL_SYSTEM_REQ_IND/g
ma466
May 28, 2009, 11:45am
4
Thanks for your code. How i could save it after i change it? Does esc wq apply for this command?
{ rm rorpelli_0713003.sql; sed 's/RORPELL_SYSTEM_REG_IND/RORPELL_SYSTEM_REQ_IND/g' > rorpelli_0713003.sql; } < rorpelli_0713003.sql
Rhije
May 28, 2009, 11:52am
6
sed is a Stream-line EDitor (see what I did there?).
Anyways, you do not esc + :wq or anything like in vim. You would either do in place editing
sed -i 'something here' file
Or you perform the action on a file and write the changed file to another file.
sed 'something here' file1 > file2
ma466
May 28, 2009, 11:55am
7
Great man, you guys are genious. Thanks for your time and efforts.