| User: editor -- 2010-07-21 |
| Hits: 47 |
| Type: Advanced search and replace |
| Search all Advanced search and replace examples |
| Description: |
| How can I keep all lines that ended with "ok" or "done" but remove all other lines? |
| Input Sample: |
| ..... line1 ...............line2 ..............line3 ok ................line4 ...........line5 done ................... |
| Output Sample: |
| ..............line3 ok ...........line5 done |
| Answer: |
| Hint: You need to Download and install "Replace Pioneer" to finish following steps. |
| 1. ctrl-o open source text file 2. ctrl-h open "replace" window * set "replace" unit to "Line" * set "Search for pattern" to: * set "Replace with pattern" to: * uncheck "print unmatched unit" option 3. click "Replace", done! |
Similar Examples: |
| How to remove all the lines that do not contain any of words in a list? (68%) How to remove all lines that contains more than one word? (67%) How to remove all blank lines and lines that started with Name: or Addr:? (62%) How to delete/remove all lines that appearred more than once? (59%) How to remove all html tags that enclose nothing or " " ? (58%) How to extract all lines that contain words A and B and C? (57%) How to remove all the lines that with odd line number for multiple files? (56%) How to change all letters that come after the word "password:" to ***** ? (56%) |
Check Demo of Advanced search and replace |