@terdon Hi Terdon. Ok so what I want to do is, I want to compare Contig1 23 of File1 with all the columns of File2 first. Since the last value of File2 is Contig1 24. That is the reason it is not printed since it falls in the range (23+10). Next I compare Contig1 42 of File1 to all the values of File2. Since the first value of File2 is Contig1 40, as 40 belongs to the range (42-10). Next I compare Contig2 68 of File1 to all the values of File2. Since there is Contig2 90, which DOES NOT fall in the range of (68+10) or (68-10). Therefore, I print it.