title: AWK binning every N lines
body: <p>I have data like this:</p>
  
  <pre><code>1
  2
  3
  4
  5
  </code></pre>
  
  <p>I want to sum (bin) every N lines in this columns, but not like:</p>
  
  <pre><code>awk '{s+=$1}NR%2==0{print s;s=0}' file
  </code></pre>
  
  <p>For example, for 2 binnings I want to sum row 1+2, 2+3, 3+4, 4+5. So it would look like this:</p>
  
  <pre><code>3
  5
  7
  9
  </code></pre>
  
  <p>For 3 binning like this:</p>
  
  <pre><code>6
  9
  12
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>My real data looks like this:</p>
  
  <pre><code>2014-04-13 17:25:33.25  5.5
  2014-04-13 17:25:53.25  27.5
  2014-04-13 17:26:13.26  -3.5
  2014-04-13 17:26:33.26  5.5
  2014-04-13 17:26:53.26  22.5
  2014-04-13 17:27:12.27  1.5
  2014-04-13 17:27:32.27  26.5
  2014-04-13 17:27:52.27  -14.5
  2014-04-13 17:28:12.28  26.5
  2014-04-13 17:28:32.28  0.5
  2014-04-13 17:28:52.28  -14.5
  2014-04-13 17:29:12.29  12.5
  2014-04-13 17:29:32.29  9.5
  </code></pre>
  
  <p>The first two columns are the time with ~20 second steps, 3 lines is ~1 minute. So, for example, I would like to sum (bin) the 3rd column to get how much it changed overall in any given 30 minutes (90 lines), or 5 minutes (15 lines).</p>