title: Finding a range of numbers of a file in another file using awk
body: <p>I have lots of files like this:</p>
  
  <pre><code>3 
  10 
  23
  .
  .
  .
  720
  810
  980
  </code></pre>
  
  <p>And a much bigger file like this:</p>
  
  <pre><code>2 0.004
  4 0.003
  6 0.034
  . 
  .
  .
  996 0.01
  998 0.02
  1000 0.23
  </code></pre>
  
  <p>What I want to do is find in which range of the second file my first file falls  and then estimate the mean of the values in the 2nd column of that range. </p>
  
  <p>Thanks in advance.</p>
  
  <p>NOTE</p>
  
  <p>The numbers in the files do not necessarily follow an easy pattern like 2,4,6... </p>