I'm very new on here and require some help matching up and printing some columns using awk.
I have two text files. The first file has Longitude data in column 1 (lon.txt) and the second one (node.txt) has again another Longitude data in column 1 (not exact as the first one) + in the second column it has a node number.
Now I need to match the closest Longitude number from the first file to the second file and print the node number.
Please note that the files sizes are also not the same. The first files has 29,572 lines, while the second file has 1755,555 lines.
I will put it to the test tomorrow, and will let you know how I got on.
Many thanks again
Cheers,
Ian
---------- Post updated 04-13-11 at 03:33 AM ---------- Previous update was 04-12-11 at 01:09 PM ----------
Hi aster007
I tottaly missed this up!!
I will try and explain again.......
I have two files lat_lon.txt and node.txt
lat_lon.txt has 1755642 lines in and in collumn 1 has lat numbers and in collumn 2 has lon numbers
eg..
Latitude Longitude 57.14824 -2.09665 57.14871 -2.09781 57.14824 -2.09665 57.14808 -2.09467 57.14843 -2.09797 57.14962 -2.09533 57.14973 -2.09474 57.14867 -2.09599
node.txt has 29648 lines in and in collumn 1 it has a node number and in collumn 2 has lat number and in collumn 3 it has a lon number
eg
1 48.39 -13 2 48.39 -12.89 3 48.39 -12.78 4 48.39 -12.67 5 48.39 -12.56 6 48.39 -12.45 7 48.39 -12.34 8 48.39 -12.23 9 48.39 -12.12 10 48.39 -12.01
Now what I need to do is to cloest match the lon and lat numbers from lon_lat.txt to the lon and lat numbers from node.txt and print the node number is a new file.