I have a file contents of which looks like this
123,1,ABC,DEF
123,1,ABC
345,4,TZY
456,3,XYZ
333,4,TTT,YYY
333,4,TTT
I want to ignore lines with the previous and next contents the same i.e lines containing 123 and 333
Output needs to be
345,4,TZY
456,3,XYZ
Any ideas on how to go about this