I'm struggling with this task:
I have two files:
file1 looks like:
102 13.342
103 7.456
105 6.453
107 3.567
108 4.210
file2 looks like:
0 098 0 0 0 -9 x
0 099 0 0 0 -9 x
0 100 0 0 0 -9 x
0 101 0 0 0 -9 x
0 102 0 0 0 -9 x
0 103 0 0 0 -9 x
0 104 0 0 0 -9 x
0 105 0 0 0 -9 x
0 106 0 0 0 -9 x
0 106 0 0 0 -9 x
0 107 0 0 0 -9 x
0 108 0 0 0 -9 x
And I want a file3 that looks like
0 098 0 0 0 -9 x
0 099 0 0 0 -9 x
0 100 0 0 0 -9 x
0 101 0 0 0 -9 x
0 102 0 0 0 13.342 x
0 103 0 0 0 7.456 x
0 104 0 0 0 -9 x
0 105 0 0 0 6.453 x
Basically, I want to join file1 and file2 by matching first and second fields in file1 and file2 respectively, keeping mismatches, and also, substituting the value of the sixth field in file2 with the value of the second field in file1 in each matching line...
I know this task is related with the use of:
join -a1 -a2 -o 1.2 whatsoever
. But cannot figure it out how to continue... Also considering awk