If the first and second columns of the next row are the same as the current row, I want to print the last column of each row to the current row.
My input file is
A 123 BC A 123 DD A 123 TT B 456 AA B 456 RR C 789 EE Desired output is
A 123 BC DD TT B 456 AA RR C 789 EE