User: Aaron -- 2013-12-05 << 1153 1155 >> |
Hits: 3376 |
Type: Advanced search and replace |
Search all Advanced search and replace examples |
Description: |
I would like a script that randomly deletes x number of lines from text files. |
Input Sample: |
line 1. aaaaaaaaaaaaa line 2. bbbbbbbbbbb line3. ccccccccccccc line 4. ddddddddddd line 5. eeeeeeeeeeeee etc. Remove 2 lines randomly. |
Output Sample: |
line 2. bbbbbbbbbbb line3. ccccccccccccc line 4. ddddddddddd etc. or line 1. aaaaaaaaaaaaa line 4. ddddddddddd line 5. eeeeeeeeeeeee etc. |
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 |