Help Please
I have 2 files. each file contain 2 columns.1st file 1st column contain symbols (keys-a1..a22..a-x,a-y) and 1st file 2nd column contain values (any like 2344,434323). Secondfile also the same but the values are may be different or not and the symbols (keys) are same but may be repeating, more or less than than 1st file 1st column.
Finding closest values (I would like to sort the data and join the the same keys (Joint and sort commands are not just doing the job I want), Then loop through this data and use an associative array/hash/<whatever> to keep track of the minimum diff between 2nd and 3rd fields for the same key.)
Tyler created some useful scripts but just not enough for this job
I'm inluding the scripts just to give some idea
I'm inculding inputfiles just for clarification
$ sorted_input1
a1tab20
a1tab30
a1tab40
a2tab20
a2tab25
a2tab67
axtab45
$ sorted_input2
a1tab20
a1tab45
a2tab89
axtab44
axtab100
axtab98
Output shouldbe
a1tab20tab20
a1tab30tab20
a1tab40tab45
a2tab20tab89
a2tab25tab89
a2tab67tab89
axtab45tab98