Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

175.Advanced search and replace -- How to make a batch replacement according to a text mapping file?

User: editor -- 2008-06-05          << 174  177 >>
Hits: 3761
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to make a batch replacement according to a text mapping file?
Input Sample:
Source file: 
============== 
this is old1, this is old2 
old3, old4, ... 
 
Content of Mapping file: 
=============== 
old1 new1 
old2 new2 
old3 new3 
...
Output Sample:
Target file 
=============== 
this is new1, this is new2 
new3, new4, ... 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. select menu 'Tools->Dictionary->Import' menu, select the mapping file to import, and select "key<spaces>value" as import format, and click 'Start' 
2. click ctrl-o to open source file 
3. click ctrl-h to open 'Replace' dialog 
 
* in 'Replace' page: 
set Replace unit to 'Word' 
set 'Search for Pattern' to: 
 
set 'Replace with Pattern' to: 
 
set 'If' to: 
 
 
* click 'Settings' page: 
set input delimiter to Other, and enter  at right(note: \W means non-word characters, like space,comma,etc.) 
 
4. Click 'Replace', done! 
 
Note: about operation can only replace the whole word, can not replace part of word. 
 
* If user also want to replace part of word, should set  
Replace unit to 'Chars', and explicitly set 'Search for pattern' to: 
 ... 
Download Script:  scripts/175.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Settings_Window


Similar Examples:
How to make multi-word replacement with a mapping list? (65%)
How to rename files according to a given mapping list? (63%)
How to batch replace the last 5 "old" with "new" in a text file? (63%)
How to rename files according to a given mapping list? (63%)
How to make search and replace only in specified lines in text file? (61%)
How to batch replace 'old' to 'new' in many pdf files? (61%)
How to batch extract specified lines from a text file? (60%)
How to search and replace in multiple files base on user-defined mapping file? (59%)

Check Demo of Advanced search and replace
Keywords:
about  keys  whole word  whole  replacement  dictionary  diction  mapping  mapping file  pages  batch file user input  word batch replacement  pattern replacement in batch file  batch replace input source  replace part of text format batch  batch text replacement  replace whole word  text replacement