Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1025.Advanced search and replace -- How to replace an random occurrence of an word with an random line?

User: Dragan Daniel -- 2012-11-16          << 1024  1026 >>
Hits: 3154
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to replace an random occurrence (only one) of an word with an random line from an external text file ( my interest is to accept as random line an url? 
Input Sample:
for example I have text source: 
"My address could be that address and this address." 
External file will be:  
<a href="http://www.hhh.com">Visit hhn</a>  
<a href="http://www.ggg.com">visit ggg</a> 
Output Sample:
result can be: 
"My address could be that <a href="http://www.hhh.com">Visit hhn</a>  and this address." 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume the external filename is d:\test\2.txt 
1. ctrl-o open text file 
2. ctrl-h open replace dialogue 
* set 'replace with pattern' to: 
 
* click 'advanced' tab, set 'run following for each matched unit' to: 
 
3. click 'replace', done. 

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to replace only one occurrence of string in text randomly? (72%)
How to replace the 2nd and 3rd occurrences of some words in multiple files? (67%)
How to replace the last occurance of 'old' in every line with 'new'? (67%)
How to remove the first occurrance of duplicated words in each line? (64%)
How to replace the all word "test" with the first word in same line? (63%)
How to replace a string with one of the specified words randomly in multiple files? (62%)
How to count the occurrence of a list of words in a text file? (60%)
How to replace some text with a random line from another file? (59%)

Check Demo of Advanced search and replace
Keywords:
external  url  unique  random line  acc  random  rando  rand  test  address  replace with random line from external file  random filename  replace url  with random line  replace with random word  word replace with random  random word text file  replace random line