title: shell script to process a file and do math on it
body: <p>I have a file with data in this format.
  The last column in the file is numeric and I need to sum every 3 records and print average</p>
  
  <pre><code>a1;b1;c1;d1;2.70
  a1;b1;c1;d1;1.30
  a1;b1;c1;d1;3.00
  a2;b2;c2;d2;7.30
  a2;b2;c2;d2;1.40
  a2;b2;c2;d2;2.50
  </code></pre>
  
  <p>The output will look like this</p>
  
  <pre><code>a1;b1;c1;d1;2.33
  a2;b2;c2;d2;3.73
  </code></pre>
  
  <p>Of course I can write a program to parse each line, tokenize using <code>;</code> and then do the math on them.
  Or I can export the data to excel and write a macro.
  But is it possible to do this is shell script?</p>