Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

910.Replace text in multiple files -- How to search and replace multiple files with rules different in sequence number?

User: editor -- 2012-01-28          << 909  911 >>
Hits: 1876
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
How to search and replace multiple files, the search/replace rules for each file are similar but has different sequence number?
Input Sample:
File1.html
File2.html
...
FileN.html
Output Sample:
================
For File1.html:
replace image/a1.jpg with image/a1-page-1.jpg 
replace image/a2.jpg with image/a2-page-1.jpg 
...
replace image/a24.jpg with image/a24-page-1.jpg 

================
For File2.html:
replace image/a1.jpg with image/a1-page-2.jpg 
replace image/a2.jpg with image/a2-page-2.jpg 
...
replace image/a24.jpg with image/a24-page-2.jpg 

================
...

For FileN.html:
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. prepare a file "replace.txt" with following content:
image/a1.jpg image/a1-page-$file_no.jpg
image/a2.jpg image/a2-page-$file_no.jpg
...
image/a24.jpg image/a24-page-$file_no.jpg
2. open "Tools->Batch Runner" window
drag multiple files from "window file browser" to "batch runner" window, make sure the files are in correct order
3. click "Fast Replace" button to open "Fast Replace" window
click "import" to import "replace.txt"
4. make sure "Reg exp" and "cross line" option are selected
5. click "Start", click "ok", done.

Similar Examples:
How to search replace multiple files with distinct search replace definition for each? (67%)
How to search/replace multiple text files base on rules from csv file? (65%)
How to search and replace multiple file with multiple regex rules? (64%)
How to remove duplicate lines in multiple files in different sub-folders? (63%)
How to batch decode multiple files that were base64 encoded? (61%)
How to batch rename files by adding parenthesis for each number? (61%)
How can I search and replace multiple strings in multiple files all at once? (60%)
How to search and replace with multiple mapping rules by regular expression? (60%)

Check Demo of Replace text in multiple files
Keywords:
similar  image  sequence number  pare  correct  jpg  import  rules  order  sequence  replace text with sequence number multiple files  search multiple text files for a sequence  multiple file sequence number  sequence number text file  replace text sequence number  replace text to sequence number  sequence multiple file  sequence number in batch file