I have a file of email addresses (file 1) and another file (file 2) of lines of data that contain some of these email addresses
I want to compare files and remove all lines in file 2 that have a matching email in file 1.
I know I can do a loop and use sed -i
or loop and grep each line to a new file then compare files with COMM
But I was wondering if there is a comparison method that I can kind of grep all lines in file1 to file2 and just be left with the lines from file2 that do not contain any emails in file 1
file 1:
[email protected]
[email protected]
[email protected]
file 2:
23456|tom|jones|test@goodemailcom|10
12345|pete|best|[email protected]|10
87569|remove3|me3|[email protected]|10
23098|mike|jones|mike@goodemailcom|10
10985|al|best|[email protected]|10
09865|removve|me|[email protected]|10
13579|remove2|me2|[email protected]|10
Appreciate any knowledge anyone has.