File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Find n Replace word in set of files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply locked New topic
Author

Find n Replace word in set of files

Sham Jowsaki
Ranch Hand

Joined: May 22, 2001
Posts: 146
Hi All,
I hv requirement like find n replacement a word in a file but the filenames are limited and the filesnames list are updated in one files.
like (fn.txt has all filenames has to be changed)
aa
bb
cc
xx
yy
zz
now I have to read this file and do the below process only on those files.
perl -pi.bak -e 's/\bFIND/REPLACEMENT/g' $(find dir -name '*.txt')

Can you please help me out in this regards
Thanks
Cheers
Jowsaki
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

I don't see a need to give this question, which extends from your other topic, its own topic space. I'm closing this and prompting readers to use the existing topic for responses.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
Don't get me started about those stupid light bulbs.
 
subject: Find n Replace word in set of files
 
Similar Threads
Finding the filenames of all the files in a directory
Finding Folders
regex needed to find all files with no extension
calling servlet from JSP
Shell scripts find n replace the word in files