Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1250.Advanced search and replace -- How to Random insert one or three line to a text file?

User: yong -- 2014-09-15          << 1249  1251 >>
Hits: 2731
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
how to Random insert one or three line to a text file?
Input Sample:
insert word list: 
http://www.aaa.com/aaa.jpg 
http://www.bbb.com/bbb.jpg 
http://www.ccc.com/ccc.jpg 
http://www.ddd.com/ddd.jpg 
http://www.eee.com/eee.jpg 
 
text file: 
<title>title one</title> 
blah blah blah blah blah  
 
blah blah blah blah blah blah blah 
 
<title>title two</title> 
blah blah blah blah blah  
 
blah blah blah blah blah blah blah 
 
<title>title three</title> 
blah blah blah blah blah  
 
blah blah blah blah blah blah blah
Output Sample:
<title>title one</title> 
blah blah blah blah blah http://www.aaa.com/aaa.jpg 
 
blah blah blah blah http://www.ddd.com/ddd.jpgblah blah blah 
 
<title>title two</title> 
blah http://www.aaa.com/aaa.jpg blah blah blah blah  
 
blah blah blah http://www.ccc.com/ccc.jpg blah blah blah blah 
 
<title>title three</title> 
blah blah blah blah blah  
 
blah blah http://www.ddd.com/ddd.jpg blah blah blah blah blah
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
0. prepare file 'd:\test\list.txt' which contains candidate list of text 
1. ctrl-o open text file 
2. ctrl-h open 'replace' dialogue 
* set 'search for pattern' to: 
 
* set 'replace with pattern' to: 
 
* click 'advanced' tab, set 'run following at the beginning of replace' to: 
 
* 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 add line_no before each line of a text file? (67%)
How to delete the first word in each line in a text file? (67%)
How to random remove x lines from a line range in text file? (66%)
How to randomly insert a word or phrase x number of times into text files? (66%)
How to delete duplicate lines of a text file? (65%)
How to join every 50 or 500 lines together in a text file? (63%)
How to insert a keyword only at first line of multiple text files? (63%)
How to count the number of words that ended with "ing" in a text file? (63%)

Check Demo of Advanced search and replace
Keywords:
x01  random insert  pare  contains  random  rando  rand  title  test  date  insert title  title split  title split file  test title  split and insert  insert beginning line  split insert text  txt title