View Single Post
  #2 (permalink)  
Old 07-20-03, 14:50
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,354
Re: Is it possible to replace word in every file?

for a single file i'll do

cat filename | sed 's/<current-word> <new-word> > filename.new
mv filename.new filename

A similar approach will work for multiple files also ...

There is likely to be a more efficient method to the same

Cheers
Sathyaram

Quote:
Originally posted by msetjadi
HI All,

I am very new in unix and i am not familiar if my requirements can be done in unix.

I need to replace a common word that exists inside thousands file,is impossible to edit one by one.

To all expert, are there any unix command that i can use to do this.
It might not be possible to do it once probably i need to creat a script but is it possible?

Do you know if there is a ready example?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote