title: Loop over column of file in bash
body: <p>I have a line of more than 70.000 lines and 11 columns. The 4th column is a position. I want to count each line that has a position that is 100 higher than the position in the above line and a 100 lower than the position in the below line.</p>
  
  <p>I would like to do this without importing the data to R, so I can put into my shell script. I am however not that experienced in shell.</p>
  
  <p>Example of data:</p>
  
  <pre><code>x    y    z    1
  x    y    z    80
  x    y    z    200
  x    y    z    310
  x    y    z    390
  x    y    z    500
  x    y    z    830
  </code></pre>
  
  <p>I want to count the 3rd and the 6th rows as their value in the 4th column is fulfilling my requirements, so my output here should be "2".</p>
  
  <p>I have tried to search for information on how to do this but have been stuck for some time now.</p>