Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

482.Advanced search and replace -- How to find out all line of text that either in A.txt only or B.txt only?

User: editor -- 2010-04-19          << 481  483 >>
Hits: 2549
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to find out all line of text that either in A.txt only or B.txt only? 
 
I have to files A.txt and B.txt, how remove all the lines that appeared in both files, and copy the rest lines to C.txt? 
Input Sample:
A.txt 
line 1 
line 2 
line 3 
line 4 
 
B.txt 
line 2 
line 4 
line 6 
line 8
Output Sample:
C.txt 
line 1 
line 3 
line 6 
line 8
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open A.txt 
2. select 'File->Load->Append File to Page' open B.txt, now A.txt and B.txt are joined together. 
3. remove all lines that appear more than once:  
ctrl-h open 'Replace' dialog 
* in 'Replace with pattern', enter: 
 
click 'Advanced' tab: 
* in 'Run following for each matched unit' entry, enter: 
 
4. click 'Replace', done! 
5. ctrl-s save to file C.txt
Download Script:  scripts/482.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to find all lines in file A that contain words in file B? (56%)
How to remove all lines in file b.txt that appearred in a.txt? (56%)
How to extract all lines that contain chem, but not any of org and cn? (55%)
How to sort all lines of text by specified keyword? (55%)
How to find out all lines that appeared specified number of times? (54%)
How to find out all files that contain all words of A, B and C? (54%)
How to findout all lines that contain specified words in multiple files? (53%)
How to remove all lines that are not ended with word "ok" or "done"? (52%)

Check Demo of Advanced search and replace
Keywords:
more than  together  remove all the lines  append  append file  ppen  remove all lines  find  copy  values  remove line both  remove lines more than  find copy replace  remove lines more  copy lines  copy line to lines  find tab  replace once