Re: Remove the Content of 1 text file from another
Ya one thing I forgot to mention, the above command only works if u have one email address per one row (line).
**risc
**here is if the full demo, I just created for ur explanation.
EMAILS-A is the list of bad address, EMAILS-B is full list.
najim@freebsd ~ >> cat EMAILS-A (list of bad addresses)
[email protected]
[email protected]
[email protected]
najim@freebsd ~ >> cat EMAILS-B
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
najim@freebsd ~ >> diff EMAILS-A EMAILS-B
0a1,2
[email protected]
[email protected]
2a5
[email protected]
najim@freebsd ~ >> diff EMAILS-A EMAILS-B|grep @
[email protected]
[email protected]
[email protected]
najim@freebsd ~ >> diff EMAILS-A EMAILS-B|grep @|sed 's/^> //'
[email protected]
[email protected]
[email protected]
najim@freebsd ~ >> diff EMAILS-A EMAILS-B|grep @|sed 's/^> //' > UNIQUE_EMAILS
najim@freebsd ~ >> cat UNIQUE_EMAILS
[email protected]
[email protected]
[email protected]
Now u can see three bad emails are gone & only good ones are left.