Possible Duplicate:
merge two files by key if exists in the first file / bash script
I am trying to think of good way to combine these two selections of text (these are example of text that is in a similar format that I would be working on), based on the number prefacing the colon. This would be done in a bash environment, I've tried thinking of ways in which I could do it using cut along with other commands, but I have not been able to come up with anything that would work.
selection 1
1:829ede2828e9
2:893h8ew9nediucn
3:mdheuwe883ud8932
selection 2
1:stack
2:over
3:flow
the output would be something along the lines of
1:stack:829ede2828e9
2:over:893h8ew9nediucn
3:flow:mdheuwe883ud8932
so it would essentially be combining and matching the files based on the number prefacing the colon. This code would be used to process around 39,000 lines of text. I am stumped at this point in time so I would really appreciate any help I can get, thanks! also forgot to mention the numbers wont be consistent (1,3,4,5,9,11,22 for example), although both files/sets of text will have the same set of numbers.