Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1036.Advanced search and replace -- How to replace text files using multiple pre-defined rules?

User: firewolf -- 2012-12-18          << 1035  1037 >>
Hits: 3267
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
i have a rule txt(or dic) like this: 
not|ic|e 
f|bi 
you|r 
t|ic|ket 
a|ct|ing 
l|itt|le 
according to the rule txt, replace match words, punctuation remain unchanged, no  
matches  remain unchanged£¬Sensitive remain unchanged
Input Sample:
Dialogue:  
0,0:03:20.02,0:03:20.82,EnText,,0000,0 
000,0000,,Notice? 
Dialogue:  
0,0:03:20.82,0:03:22.30,EnText,,0000,0 
000,0000,,May I see your ticket? 
Dialogue:  
0,0:03:37.15,0:03:39.17,EnText,,0000,0 
000,0000,,You are acting a little .
Output Sample:
Dialogue:  
0,0:03:20.02,0:03:20.82,EnText,,0000,0 
000,0000,,Not/ic\e? 
Dialogue:  
0,0:03:20.82,0:03:22.30,EnText,,0000,0 
000,0000,,May I see F/BI\ you/r\  
t/ic\ket? 
Dialogue:  
0,0:03:37.15,0:03:39.17,EnText,,0000,0 
000,0000,,You are a/ct\ing a l/itt\le.  
.
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
first of all, generate a mapping table like: 
notice,not|ic|e 
fbi,f|bi 
your,you|r 
ticket,t|ic|ket 
acting,a|ct|ing 
little,l|itt|le 
 
Procedure: 
1. ctrl-o open the origial rule file 
2. ctrl-h open 'replace' windows 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
Note: if you want to generate upper case rules like: FBI,F|BI 
You can use: 
 
3. click 'replace', the mapping file is generated 
4. ctrl-s save to rule.txt 
 
Secondly, you can replace your files with the rules from rule.txt. 
1. open "Tools->Batch Runner" window 
2. drag multiple text files in to batch runner window 
3. click "fast replace" 
4. click "import" to import rules from rule.txt 
5. check option of "reg exp" 
6. click "start", done.

Screenshot 1:  Replace_Window


Similar Examples:
How to search and replace multiple file with multiple regex rules? (70%)
How to insert mulitple text files into multiple html files? (67%)
How to refine multiple text files by specified rules? (64%)
How to split a text file into multiple files evenly on size? (62%)
How to move and rename files from multiple folder with specified order? (61%)
How to read each line of a file and insert into multiple files? (60%)
How to rename file by sequence id with specified pre-defined order? (60%)
How to remove/delete first column for multiple files? (59%)

Check Demo of Advanced search and replace
Keywords:
ucfirst  generate upper case  punctuation  unctuation  matches  upper  upper case  table  mapping  mapping file  search replace text file from table  replace text in multiple files using batch  batch mapping table  batch upper case  batch case upper  batch file upper  batch file to upper case  upper in batch file