This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply locked New topic

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)
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
Michael Ernest
High Plains Drifter

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
I agree. Here's the link:
subject: Find n Replace word in set of files
It's not a secret anymore!