File 1 File2 Col 1 Col2 Col3 Col4 Col 1 Col2 Col3 Col4 1 2 3 4 4 3 2 1 4 3 2 1 a b c d 10 11 12 13 12 11 13 10 a1 b c d a4 b4 c d4 Line 1: no matches Line 2: # F1, L2 matches F2, L1 Line 3: # F1, L3,Col2 matches F2, L3, Col2 Line 4: # F1, L4,Cols 2, 3 & 4 match F2, L2, Cols 2, 3 & 4 # and also matches contents of F2, L4, Col3 # Do both satisfy your criteria?