| User: editor -- 2010-07-21 << 568 570 >> |
| Hits: 321 |
| 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" on windows platform 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! |
Screenshot 1: Replace_Window |
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 lines that contain one or more words in a list? (62%) How to remove all blank lines and lines that started with Name: or Addr:? (62%) How to remove all lines that have duplicate contents in CSV files? (61%) How to delete/remove all lines that appearred more than once? (59%) How to remove all the lines appeared in file B,C,D from file A? (58%) How to remove all html tags that enclose nothing or " " ? (58%) |
Check Demo of Advanced search and replace |
| Keywords: |
| keep unmatched remove all line unmatch print end matched how to remove remove remov remove word remove lines all remove lines remove all text remove not not word remove text replace all word |