Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1413.Advanced search and replace -- How to replace text conditionally with custom dictionary?

User: Dilip -- 2017-12-31          << 1412  1414 >>
Hits: 3226
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
If the word print is found in a line,  
 
then replace the words: 
one with 1 
two with 3 
three with 3 
 
using the custom dictionary found at d:\\test\\dictionary.txt 
Input Sample:
this is a test 
print one 
print one two three 
print three
Output Sample:
this is a test 
print 1 
print 1 2 3 
print 3
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Make sure d:\test\dictionary.txt has following format: 
 
1. ctrl-o open text file 
2. ctrl-h open 'replace' dialog: 
* set 'replace unit' to 'Line' 
* 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.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to replace different words conditionally? (59%)
How to replace text containing some special symbols in a text file? (56%)
How to replace the characters in fixed position in each line? (56%)
How to replace bytes in the specific postion of many binary files? (55%)
How to replace file content in multiple files with corresponding filename? (54%)
How do I replace a partial constant in my file with one by one lines in a dictionary file? (54%)
How to replace a character based on its position in line? (53%)
How to replace specific column with specific rule in csv file? (51%)

Check Demo of Advanced search and replace
Keywords:
conditional  condition  diction  dictionary  found  dic  key  two  import  values  split dictionary txt  split of dictionary file  split the dictionary  split a dictionary file  split dictionary file  split dictionary text file  dictionary file split  join two text file