Extract rows having the 11th column values lies between 1st and 2nd of a second file : Hello I have two files 

file1 : 
                                                             11th column 
chromosome position another.... tag name.....score .....          sum
chr1       816 .....                                            2456.50                                          
chr1       991 .....                                             50345
chr2       816 .....                                             2456.50
chr2       880 .....                                             78939
chr2       18768 .....                                           678909
...
chr5      9736286 ....                                           78905




file2 
chromosome   start    end .....    .....    ..... 
   chr1       2450    2460
   chr2      50340    50350
   chr2      678900   678920
   chr5      9736280  9736290

I'm interested in printing rows from file 1 using a python code if the values of 11th column falls within the range start and end (2nd and 3rd columns )declared in the seconds file. As the position is only unique within a certain chromosome (chr) first it has to be tested if the chr's are identical... hence my desired output is  

chromosome position another.... tag name.....score .....          sum
chr1       816 .....                                            2456.50
chr2       18768 .....                                           678909
chr5      9736286 ....                                           78905


I have tried awk codes.. it works perfectly fine but they are very very slow ! 

The files I'm testing ( from which I need to print the rows are around 4 GB ).

I would highly appreciate if I can have some python code 

Thanks ! 
 
