Page 1 of 1

Batch Search and Replace

Posted: Fri Nov 07, 2014 8:47 pm
by gkeeler
I like to use a text file with one pair of search and replace criteria on each row with the pair separated by a comma or tab. Then run the search and replace through all files within a folder. Should be able to select files to process using wild cards and also specify writing the replaced files to a different folder. Dreaming!

Most of the pieces needed already in TextPad

Posted: Mon Nov 10, 2014 1:16 am
by gkeeler
Most of the pieces already exist in the 'Find In Files' process:
- Seach folders ('In folder') and subfolders (search subfolders checkbox)
- regular expressions
- list of files and lines where the search item is found
(listed in Search Results)
- Replace All in All Documents
- Save All

The only part of the process that is missing from text pad is a loop that
puts all the 'Find In Files' options together:

Pre-loop:
import the search and replace criteria file
Loop start:
- parses the search and replace string in each row of the file
- inserts the search and replace strings into the Find In Files process one row at a time
- run the Find In Files search
- Open All
- 'Replace All' in 'All Documents'
- Save All
Loop end: Lather, Rinse, Repeat

A nice addition would be an option to save the results to another folder.

Here's a look at some software that does Batch Search and Replace (see the 3rd screenshot for the Batch Search and Replace setup screen).
http://www.digitalvolcano.co.uk/tcscreenshots.html

[/u]