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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change a string in mutilple files

Status
Not open for further replies.

zubnus

Programmer
Apr 22, 2003
8
US
Hi All,

I want to change a string say "old_fieldname" to "new_fieldname" in all the files where old_fieldname is present.

do I have to use find command ??
 
1. yes, if your files are spread around the file system
2. no, if your files are located in the same directory

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
can you please tell me the command to do this .

Thanks in Advance.
 
which case - 1 or 2?

I think a better forum for questions like this might be UNIX Scripting Forum.

But... you'll have to investigate: find, sed, ex [and maybe awk].

It also might be helpful to see your sample text file.

Good luck.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top