Hello,
Here is file1...
Fri Feb 17 2012, 03:20 GMT 14:20 Local, Australia v Sri Lanka,Sydney, Commonwealth Bank Series
Fri Feb 17 2012, 06:00 GMT 19:00 Local, New Zealand v South Africa,Wellington, 1st T20I
Sat Feb 18 2012, 11:00 GMT 15:00 Local, England v Pakistan,Dubai (DSC), 3rd ODI
Sat Feb 18 2012, 22:30 GMT 18:30 Local, West Indies v India (Women),North Sound, 1st T20I
Sun Feb 19 2012, 01:45 GMT 14:45 Local, New Zealand v England (Women),Hamilton, 2nd T20I
Sun Feb 19 2012, 03:20 GMT 13:20 Local, Australia v India,Brisbane, Commonwealth Bank Series
Here is file2...
Feb 17 2012,New Zealand v South Africa,1st T20I
Feb 17 2012,Australia v Sri Lanka,Commonwealth Bank Series
From file1 I need to remove lines based on the contents file2. I cant simply use "grep -f" as the string match is not exact. I read in the variable values for each line with FS=, and use "egrep -v" as below...
while IFS=, read A B C
do
egrep -v "$A.*$B.*$C" file1 > temp
mv temp file1
done < file2
Looking for a simpler, one-line approach please...
Thanks in advance...
Arun
Here is file1...
Fri Feb 17 2012, 03:20 GMT 14:20 Local, Australia v Sri Lanka,Sydney, Commonwealth Bank Series
Fri Feb 17 2012, 06:00 GMT 19:00 Local, New Zealand v South Africa,Wellington, 1st T20I
Sat Feb 18 2012, 11:00 GMT 15:00 Local, England v Pakistan,Dubai (DSC), 3rd ODI
Sat Feb 18 2012, 22:30 GMT 18:30 Local, West Indies v India (Women),North Sound, 1st T20I
Sun Feb 19 2012, 01:45 GMT 14:45 Local, New Zealand v England (Women),Hamilton, 2nd T20I
Sun Feb 19 2012, 03:20 GMT 13:20 Local, Australia v India,Brisbane, Commonwealth Bank Series
Here is file2...
Feb 17 2012,New Zealand v South Africa,1st T20I
Feb 17 2012,Australia v Sri Lanka,Commonwealth Bank Series
From file1 I need to remove lines based on the contents file2. I cant simply use "grep -f" as the string match is not exact. I read in the variable values for each line with FS=, and use "egrep -v" as below...
while IFS=, read A B C
do
egrep -v "$A.*$B.*$C" file1 > temp
mv temp file1
done < file2
Looking for a simpler, one-line approach please...
Thanks in advance...
Arun