Remove the Content of 1 text file from another

Re: Remove the Content of 1 text file from another

Excellent solution! :k: :k: - totally forgot about diff… arrggh! too much Windows for the last few years.

Re: Remove the Content of 1 text file from another

Good stuff exactly what I was looking for. I had a play with diff but could not get it to work for me. Not really done much of UNIX scripting, do you mind explaining exactly what is happening in ^

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.

Re: Remove the Content of 1 text file from another

Thanks :-)

Re: Remove the Content of 1 text file from another

if these files could be opened in excel then use the VLOOKUP function. :)