Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help for word replace in file

Status
Not open for further replies.

6656

Programmer
Nov 5, 2002
104
US
I try to replace matched-words (not patterm)in a file by using SED command. Does someone can give some sample how to do it? Or make correction what I did below. Thanks. Mike

RULE_FILE contains: s/com/commsup/g
s/abc/xyz123/g
..........
TARGET_FILE might contains: abcdefg computor 'abc' # not replace.
abc.com com; &abc /com "abc" abc, .. # need to be replaced.

The command I used:
Unix prompt$> sed -f RULE_FILE/TARGET_FILE > NEWFILE

 
change the / to space in you cmd -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
Thanks Jamisar, You're right that I typed wrong by mistake in my message. I acturally typed below in the cmd line.

The command I used:
Unix prompt$> sed -f RULE_FILE TARGET_FILE > NEWFILE

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top