I have two text files. File 1 has 150 ids but all the ids exists in duplicates so it has 300 ids in total. File 2 has 1500 ids but all exists in duplicates so file 2 has 300 ids in total. i want to match the first occurance of every id in file 1 with first occurance of thet id in file 2 and 2nd occurance of id in file1 with the 2nd occurance of id in file 2. and based upon the value in column 2 print match or mismatch. Looking for an awk sed solution
File1
1 12
1 13
2 15
2 16
4 15
4 18
File2
1 13
1 13
2 15
2 17
3 12
3 12
4 15
4 18
5 14
5 14
Desired output (Id, col 2 from file 1, col 2 from file 2, match or mismatch)
1 12 13 mismatch
1 13 13 match
2 15 15 match
2 16 17 mismatch
4 15 15 match
4 18 18 match