Suppose file1 has contents:
1=apple 2=mango 3=banana 4=litchi 7=papaya
and file2:
1=apple 2=banana 3=grapes 4=kiwi 5=orange