I have a problem trying to merge content of two files :
file 1 :
873 1.1.1.1
1033 99.99.99.10
1108 78.2.204.174
1257 78.2.8.181
file 2:
test1 78.2.8.181 p6
test2 99.99.99.10 p9
test7 1.1.1.1 p10
test8 78.2.204.174 p4
I want to merge the two file into one file like this, taking in consideration that the shared columns is the second one, & it must be compared to fit the line in question:
873 1.1.1.1 test7 p10
1033 99.99.99.10 test2 p9
1108 78.2.204.174 test8 p4
1257 78.2.8.181 test1 p6
I've tried several things using awk but without success.