Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

731.Advanced search and replace -- How to find all lines in file A that contain words in file B?

User: Lang -- 2011-03-03          << 730  732 >>
Hits: 3350
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
find all lines in file a that contain words in file b £¬with the sequence of words in file b£¬not file a¡£
Input Sample:
file a : 
i love buffalo aaa 
the line contain zzz 
the line contain ccc  
the line contain aaa again 
the line contain bbb 
the line contain none key words 
 
file b: 
aaa 
bbb 
ccc 
zzz 
 
 
Output Sample:
i love buffalo aaa 
the line contain aaa again 
the line contain bbb 
the line contain ccc  
the line contain zzz 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open file b.txt 
2. ctrl-h open replace window 
* set 'replace unit' to 'Line' 
* set 'replace with pattern' to: 
 
* click "Advanced Page": 
set 'run following at the beginning of replace' to: 
(assume file a.txt is in d:\test\ folder) 
 
* set 'run following for each matched unit' to: 
 
3. click 'replace', done! 
4. ctrl-s save to new file.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to find out all files that contain all words of A, B and C? (76%)
How to extract all lines that contain words A and B and C? (74%)
How to extract all lines that contain specific words in a file? (72%)
How to extract all lines that contain words in a list? (72%)
How to findout all lines that contain specified words in multiple files? (72%)
How to delete all lines that contain only a word and a blank? (69%)
How to re-group all lines in a file by a wordlist file? (67%)
How to remove all lines that contain one or more words in a list? (65%)

Check Demo of Advanced search and replace
Keywords:
grep  pages  led  find  sequence  test  seq  at the beginning  beginning  ass  lines contain words  replace with a sequence of words  search for lines beginning  lines beginning with  replace lines that contain  find pattern in file replace  lines to new file  find and replace