I have 2 files,
head file1
1 115258827 12 HG00099
1 115258827 5 HG00100
1 115258827 8 HG00101
1 115258827 6 HG00103
1 115258827 4 HG00108
1 115258827 3 HG00110
1 115258827 4 HG00111
1 115258827 2 HG00114
1 115258827 8 HG00115
1 115258827 5 HG00116
and another file
head file2
HG00096 0|0
HG00097 0|0
HG00099 0|0
HG00100 0|1
HG00101 0|0
HG00102 0|0
HG00103 0|0
HG00105 0|0
HG00106 0|0
HG00107 0|0
I want to check if the last column of file1 matches the first column of file2, add the second column of file 2 to file1, ending up with something like
head desired
1 115258827 12 HG00099 0|0
1 115258827 5 HG00100 0|1
1 115258827 8 HG00101 0|0
1 115258827 6 HG00103 0|0