I have two files
tmp1.txt
aaa.bbbbb.txt
bbb.aaaaa.txt
ddd.bbbbbb.txt
mmm.cccccc.txt
tmp2.txt
aaa first
bbb second
ccc third
ddd fourth
eee fifth
fff sixth
I want to compare these two files tmp1.txt and tmp2.txt such that first it use anything before the first"." i.e aaa,bbb,ccc,ddd and search that in tmp2.txt and if it finds the match displays as
aaa.bbbbb.txt first
bbb.aaaaa.txt second
ddd.bbbbbb.txt fourth
Thanks