Hi,
I hope somebody can help me with this problem, since I would like to solve this problem using awk, but im not experienced enough with this.
I have two files which i want to match, and output the matching column name and row number.
One file contains 4 columns like this:
FILE1:
a b c d
10.5 20.2 50.4 100.2
200.1 500.4 20.6 10.4
and the second file just one column with entries:
FILE2:
12
50
200
I want for the entries in FILE2, to find the value they match to in FILE1, within a certain range of 2 (so +/- 2). And output the column name and the row number
So the output would be:
12 a 1
50 c 1
200 a 2
I can do this using loops, but this takes long because of the size of the files.
Is there a way of doing this using AWK?
Sorry I don't have any code of what I tried yet. I was trying code from previous questions, but didn't really get close to what I need..