Sorry for the duplicate post as there seem to be hundreds of similar posts - I have searched - however due to my limited scripting knowledge I can not seem to modify any of the other answers to suit my needs.
I have two files:
ONE: Each value, h1, h2 etc... only appears once.
h1 0000 0000
h2 0000 0000
c 0000 0000
ca 0000 0000
c1 0000 0000
TWO: Values h1... can appear more than once or may not appear at all i.e. h2
h1 1 2 3 4
c 1 2 3 4
ca 1 2 3 4
h1 1 2 3 4
c1 1 2 3 4
h1 1 2 3 4
If the first columns match the values from the first file need to be appened to the second.
i.e.
h1 1 2 3 4 0000 0000
c 1 2 3 4 0000 0000
ca 1 2 3 4 0000 0000
h1 1 2 3 4 0000 0000
c1 1 2 3 4 0000 0000
h1 1 2 3 4 0000 0000
I have attempted this with python and awk.
Any help would be greatly appreciated!