User: Aaron Allan -- 2013-03-02 << 1059 1061 >> |
Hits: 3136 |
Type: Advanced search and replace |
Search all Advanced search and replace examples |
Description: |
This is a variation of 1056.Text sort. I would like to randomly remove comma delimited sentence fragments in two ways: 1. Remove random fragments based on percentage of total fragments. For example, remove 30% of all sentence fragments in text. 2. Remove every nth sentence fragment. For example, remove every 3rd sentence fragment. |
Input Sample: |
Input Sample: Sentence fragment A, fragment B, fragment C, fragment D. Sentence fragment E, fragment F, fragment G. Sentence fragment H, fragment I, fragment J, fragment K, fragment L. etc. |
Output Sample: |
Output Sample: 1. Sample output (random 30% removed): Sentence fragment A, fragment C, fragment D. fragment F, fragment G. Sentence fragment H, fragment J, fragment K, etc. 2. Sample output (Every 3rd fragment removed): Sentence fragment A, fragment B, fragment D. Sentence fragment E, fragment G. Sentence fragment H, fragment J, fragment K, etc. |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
## Remove 30% of all sentence fragments in each line: 1. ctrl-o open text file 2. ctrl-h open replace dialogue * set 'replace unit' to 'Chars' * set 'replace scope' to 'Line' * set 'replace with pattern' to: * click 'advanced' tab, set 'run following for each matched unit' to: 3. click 'replace', done. ## Remove every 3rd sentence fragment in each line 1. ctrl-o open text file 2. ctrl-h open 'replace' dialogue * set 'replace unit' to 'Chars' * set 'replace scope' to 'Line' * set 'unit number filter' to : * set 'search for pattern' to: 3. click 'replace', done! |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |