Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

563.Advanced search and replace -- How to update many htmls by adding some paragraphs at the specific position?

User: SilentHunter4 -- 2010-07-12          << 562  564 >>
Hits: 354
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
I always keep 100 html files in hand,and update a "seed" file day by day,after I update the seed, I need to copy the change to all 100 html files,these changes are the same,just add some paragraphs,but since these paragraphs are here and there in the seeds,I would like to know how to copy the changes at one time to all files.

Input Sample:
Today, I add some paragraph to my seed file:

<tr><td>I would like a cup of coffee.</td></tr>
.
.
.
.
maybe after n lines, another added paragraph:
<tr><td>I hate the hot wheather.</tr></td>
.
.
.
and so on.
Output Sample:
I need these changes be transfered to all 100 html files,changes would be all the same, those added paragraphs are the same, the only problem is they are not at one place,but located in different positions in the seed file.
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
For example, if you need to add <span>...</span> after the second <p...</p>,
and add <a href....</a> after the third <p...</p>:
1. open "Tools->Batch Runner" menu
2. drag all html files from "Windows File Browser" to "Batch Runner" window
3. click "Fast Replace" button, click "Add" and fill following in "Find" entry:

fill following in "Replace" entry:

click "OK".
4. make sure "regular expression" options are selected and click "start", all files will be replaced according to the regular expression you have entered here.

Note: in "Fast Replace" regular expression, all the special symbol must be leaded by a backslash "\", for example, "</p>" will be "<\/p>"

Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to change the number part of many filenames by adding some specified value? (56%)
How to validate many email addresses in a text file and export them? (53%)
How to add some number to the specific column in csv file? (51%)
How to add a space at the specific location of each line? (50%)
How to break down each line into 3 lines at specific position? (50%)
How to rename files by adding folder name ahead and sequence behind? (49%)
How to align text to the right side in each line by adding spaces at the left? (49%)
How to shuffle all lines without moving some specified  lines? (48%)

Check Demo of Advanced search and replace
Keywords:
span  paragraphs  position  third  href  a href  backslash  special  specific  symbol  search and replace for htmls  replace position  copy a file 100  regular expression example replace how to  replace in many html files  a regular expression to add  many html files  copy files