Forum Moderators: bakedjake

Message Too Old, No Replies

Find and Replace text within file(s)

         

secnea

10:57 am on May 6, 2003 (gmt 0)

10+ Year Member



I'm looking for a command to Find and Replace text within file(s). It's not awk but another 3-letter command. Anyone know?

Mohamed_E

11:37 am on May 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, secnea!

Sounds like you want sed (Stream EDitor).

[edited by: Mohamed_E at 11:38 am (utc) on May 6, 2003]

jamesa

11:38 am on May 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



are you thinking of sed? as in:

sed 's/findstring/replacestring/g' infile > outfile

secnea

11:50 am on May 6, 2003 (gmt 0)

10+ Year Member



Yes, that's it. For the life of me, I couldn't recall that command. Thanks!