User: SilentHunter4 -- 2010-07-09 << 560 562 >> |
Hits: 3290 |
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 |