Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

569.Advanced search and replace -- How to remove all lines that are not ended with word "ok" or "done"?

User: editor -- 2010-07-21          << 568  570 >>
Hits: 1929
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 can be found in another file? (64%)
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 remove or keep the lines started with a word of number? (60%)
How to delete/remove all lines that appearred more than once? (59%)

Check Demo of Advanced search and replace
Keywords:
keep  remove all lines  unmatched  remove all line  unmatch  print  remove all  end  matched unit  how to remove  keep lines  remove lines with word  remove word  remove lines all  remove lines with  remove lines  remove all text  open print