User: Aaron -- 2013-12-06 << 1154 1156 >> |
Hits: 3362 |
Type: Advanced search and replace |
Search all Advanced search and replace examples |
Description: |
Thanks so much for script 1154. I would like to add the option to randomly delete x lines within a specified range only as per the example below. The example shows only a small line range and it should work on a large range, e.g. between lines 1 and 2,000 etc. also. |
Input Sample: |
Input Sample: line 1. aaaaaaaaaaaaa line 2. bbbbbbbbbbb line 3. ccccccccccccc line 4. ddddddddddd line 5. eeeeeeeeeeeee etc. line 10.jjjjjjjjjjjjjjjjjjjj Remove 2 lines randomly from range of lines 1 to 5 only . Lines after 5 remain. |
Output Sample: |
line 2. bbbbbbbbbbb line 3. ccccccccccccc line 4. ddddddddddd etc. line 10.jjjjjjjjjjjjjjjjjjjj or line 1. aaaaaaaaaaaaa line 4. ddddddddddd line 5. eeeeeeeeeeeee etc. line 10.jjjjjjjjjjjjjjjjjjjj |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. ctrl-o open text file 2. ctrl-h open 'replace' dialogue * set 'replace with pattern' to: * click 'advanced' tab: set 'run following for each matched unit' to: 3. click 'replace', done. 4. ctrl-s save to file. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |