Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

673.Advanced search and replace -- How to remove all lines that contain ABC but not contain DEF in text file?

User: editor -- 2010-12-08          << 672  674 >>
Hits: 2073
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to remove all lines that contain ABC but not contain DEF in text file?
Input Sample:
1..... ABC ..... 
2....ABC....DEF 
3....DEF..ABC... 
4.ABC........... 
5..DEF....
Output Sample:
2....ABC....DEF 
3....DEF..ABC... 
5..DEF.... 
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: 
 
* check option of "Enhanced Regular Exp" 
3. click "replace" done!

Screenshot 1:  Replace_Window


Similar Examples:
How to remove all lines that contain some specific strings in a text file? (74%)
How to remove all lines that can be found in another file? (69%)
How to remove all the lines that do not contain any of words in a list? (67%)
How to extract all lines that contain A, but not any of B C D? (66%)
How to remove all lines that contains more than one word? (66%)
How to extract all lines that contain chem, but not any of org and cn? (65%)
How to extract all lines that contain "abc" from multiple files? (64%)
How to remove all lines that contain one or more words in a list? (63%)

Check Demo of Advanced search and replace
Keywords:
abcd  abc  remove all lines  remove all line  not contain  remove all  regular  regula  regular exp  contain  remove lines contain  remove not contain  contain remove line  remove line contain  replace lines that contain  remove lines all  lines contain  remove lines