Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

407.Advanced search and replace -- How to replace all words PLACE_HOLDER with title of the html file?

User: editor -- 2010-01-30          << 406  408 >>
Hits: 841
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to replace all words PLACE_HOLDER with title of the html file?
Input Sample:
<html>
....
<title>Testing Webpage</title>
....
This is PLACE_HOLDER 1
This is PLACE_HOLDER 2
....
Output Sample:
<html>
....
<title>Testing Webpage</title>
....
This is Testing Webpage 1
This is Testing Webpage 2
....
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source html file
2. ctrl-h open replace dialog
* in 'replace with pattern', enter:

3. click 'Replace', done!
4. ctrl-s save to file.

Note: 
* $match is the whole text
* replace($match,'.*?<title>(.*?)<\/title>.*','$1') is to extract title from file
* replace($match,'PLACE_HOLDER', ...) is to replace 'PLACE_HOLDER' with title.
Download Script:  scripts/407.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to replace a word only one time in multiple text files? (60%)
How to reverse all the words in each line of a csv file? (60%)
How to replace non-fixed text pattern in a html file? (59%)
How to replace all the word 'TEMPLATE' with each word in a dictionary file in sequence? (59%)
How to extract all image links from multiple html files?  (57%)
How do I replace all the tags <hr /> in many html files? (57%)
How to replace all the numbers in a text file to the square value? (56%)
How to batch replace all words 'tool' with 'software' only in Title part of many HTML files? (56%)

Check Demo of Advanced search and replace
Keywords:
extract title  whole  title  how to replace all words  extract  extra  html  htm  old  replace all word  whole words  extract html title  extract title html file  html title extract  extract title from text file  html title from text file  extract all words from text  html title