Many thanks frappa and Scrutinizer, your codes work very nice in my example , the thing is that when I use them in bigger files, for some reason the output is not complete, please let me attach those files, they are fileA (two columns file) and fileB (one column file). The output should have the same length as the fileB (15287 records) but only has around 15150 records, why should be that?
wow man, you're really good, thank you so much, I thought my fileB.txt was complete but it isn't. Sorry for bothering you again but, even though I can complete it manually, I was wondering if with your last awk code is possible to "fill" those non-matches with the closest value, I mean, no interpolation between the values in the 2nd column where the value is missing, but matching the closest one in the first column, something like this:
fileB.txt (where 689 record, 1st and 2nd column, is missing)
688 6.42
689 missing
690 6.42
fileA.txt
689.52
688.867
688.935
688.32
desired output: (where 688.867 is rounded to 689, so no 2nd-column value there, then it may be taken from 688 or 690 in fileB.txt)