Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

948.Replace text in multiple files -- How to search same text in differnt files and replace with different strings?

User: editor -- 2012-05-19          << 947  949 >>
Hits: 3428
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
How to search text XXXXX in multiple files, and in each file replace XXXXX with different strings, the new strings are prepared in advance.
Input Sample:
=============================== 
words.txt with following lines: 
string1 
string2 
string3 
 
=============================== 
There are some html files: 
file1.html 
file2.html 
file3.html
Output Sample:
replace XXXXX in file1.html with string1 
replace XXXXX in file2.html with string2 
replace XXXXX in file3.html with string3 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume replace strings are saved in a file d:\test\words.txt 
 
1. open "Tools->Batch Runner" menu 
2. drag multiple files from windows file browser to "Batch Runner" window 
3. click "Fast replace" button to open "Fast Replace" dialogue. 
* click "add" to add new replace rule 
* set 'search' to:  
* set 'replace' to:  
* click 'ok' 
4. click "start", done.

Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to batch rename text files with random line from file contents? (58%)
How to search specified pattern in a text file and remove spaces in it? (58%)
How to create a serial files from a template file with "_TAG_" replaced by different strings? (58%)
How to move text before first square bracket to the replace of the parenthesis? (55%)
How to sort each line of text by the order of reversed line? (55%)
How to batch rename text files by adding the value of file content to filename? (55%)
How to merge columns of 2 files with the same name in different folder? (54%)
How to remove duplicate lines in multiple files in different sub-folders? (54%)

Check Demo of Replace text in multiple files
Keywords:
xxxxx  xxx  replace strings  strings  two  pare  same  replace with different  test  replace string  replace same with different  replace different to same  search and replace multiple strings in multiple files  windows replace multiple strings in a file  search replace multiple strings in file  replace multiple strings  strings files  same files