Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1096.Advanced search and replace -- How to replace strings with words in a list in sequence or randomly?

User: Aaron -- 2013-07-06          << 1095  1097 >>
Hits: 3417
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
I would like a script that replaces bracket delimited text in one file with different bracket delimited text from another file. Replacements should be done in sequence with an option for random inserts.
Input Sample:
The tall man met his friend on the street. (How are you today, Bob?) 
(Not bad,) Bob answered. (How about you?) 
(Things could be better, I guess.) The tall man looked away. 
 
Replacement file list: 
 
(Did you hear the news about Ralph?) 
(No,) 
(I thought he moved away.) 
(He was in an accident.)
Output Sample:
Sequential Output: 
 
The tall man met his friend on the street. (Did you hear the news about Ralph?) 
(No,) Bob answered. (I thought he moved away.) 
(He was in an accident.) The tall man looked away. 
 
 
Random Output Example: 
 
The tall man met his friend on the street. (He was in an accident.) 
(I thought he moved away.) Bob answered. (Did you hear the news about Ralph?) 
(No,) The tall man looked away.
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
assume your list file is d:\test\word_list.txt 
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: 
 
3. click 'replace', done. 
 
Note:  
1. you should use double backslash like d:\\test\\word_list.txt 
2. if you want to replace them randomly, you can change  'replace with pattern' to: 

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to replace strings in one file with words from another file sequentially? (67%)
How to replace strings in hundreds of html files in one action? (66%)
How to replace a list of words with one single word? (64%)
How to replace one specified word with a sequence of words from a file? (63%)
How to replace a repeated string in unsequenced order? (62%)
How to randomly replace each word with a list of pre-defined words? (61%)
How to replace a word with a list of words repeatly in a text file? (61%)
How to replace a word/string with increasing sequence number in a text file? (60%)

Check Demo of Advanced search and replace
Keywords:
asp  delimited  bracket  ray  array  replacement  random insert  unique  backslash  randomly  randomly replace words  replace list another  replace text with list random  random sequence of text  random text sequence  tab delimited  replace with random words  double words