Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

561.Advanced search and replace -- How to replace one part of html with corresponding part from another?

User: SilentHunter4 -- 2010-07-09          << 560  562 >>
Hits: 1779
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to replace certain part of one batch of html files with corresponding part from another batch of html files?
For example:
I have 100 html files named Lib0001.html---Lib0100.html
I have another 100 html files named Mix0001.html---Mix0100.html
All Lib*.* has a part between tags,<P>........</P>,including a certain text paragragh.
All Mix*.* has a part between <S>........</S>
How to replace paragragh <P>....</P> in Lib0001 with <S>......</S> in Mix0001 and
do it all 100 pairs of files? Thanks!
Input Sample:
<P var fe = FindFrame("toc", top);
if ((fe != null) && (chmtop.c2wtopf.jstree != null)) {
  if (chmtop.c2wtopf.FITEMS[chmtop.c2wtopf.pagenum] != chmtop.c2wtopf.pageid)
    chmtop.c2wtopf.jstree.OpenTreeNode("source/" + chmtop.c2wtopf.pageid);
</P>
Output Sample:
<S class="last-para">In specific cases, women embrace those brands
that were developed to meet their gender-specific needs,
highlighting "for women" or "for her" in their title and
packaging.</S>
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Firstly, load all Mix0001.html--Mix0100.html <S...</S> into system dictionary:
1. ctrl-h open 'replace' window
* in 'search for pattern', enter:

click 'Advanced' page
* set 'Run following for each matched unit' to:

2. click 'Batch' button open 'Batch Runner' window
3. drag all Mix0001.html--Mix0100.html from 'Windows file browser' to 'Batch Runner' window, sort the file by correct order.
4. change the entry of 'set output filename' entry to blank(clear default "${FILENAME}")
5. click 'Batch Replace' button.

Secondly, update all Lib0001.html---Lib0100.html:
1. ctrl-h open 'replace' window
* in 'search for pattern', enter:

* in 'replace with pattern', enter:

2. click 'Batch' button open 'Batch Runner' window
3. drag all Lib0001.html--Lib0100.html from 'Windows file browser' to 'Batch Runner' window, sort the file by correct order.
4.click 'Batch Replace' button, done!
 

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Screenshot 3:  Replace_Window


Similar Examples:
How to replace some text with a random line from another file? (63%)
How to replace file content in multiple files with corresponding filename? (63%)
How to convert asp code to corresponding hex bytes separated by comma? (59%)
How to update values in xml file according to values from another xml? (58%)
How to change the number to the corresponding letter base on mapping table? (56%)
How to replace a string in one text file with random words from another file? (56%)
How to replace only one occurrence of string in text randomly? (54%)
How to replace everything outside brackets with lines from another file? (53%)

Check Demo of Advanced search and replace
Keywords:
mix  paragragh  x01  dictionary  diction  system  tags  dic  tag  correct  text replace pairs from file  batch file to replace one file with another  replace certain text  replace text from one file to another  replace text from another file  batch file replace part of the filename  batch replace part of filename  batch file to replace part of a filename