Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Search for text in multiple Word files via the Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Search for text in multiple Word files via the Terminal
Authored by: Glide on Feb 24, '05 02:14:31AM

Once you find what you're looking for you might then want to change the sought after text to something else. Say all instances of 'dog' to 'cat' as one example...

find . -type f -name '*.doc' | xargs -n1 perl -p -i -e 's/dog/cat/g'

the perl code will edit in place and make a backup of the original file being edited at the time. All instances of 'dog' will now be 'cat'. Very handy...



[ Reply to This | # ]