title: Cummulative to individual using awk
body: <p>I have following datafile where the values are in cumulative to some point (until row1 > row2):</p>
  
  <pre><code>ifile.txt
  6
  7
  10
  34
  -999
  -999
  0
  2
  4
  8
  12
  12
  -999
  -999
  -999
  -999
  12
  13
  15
  </code></pre>
  
  <p>I would like to print all individual values without considering the undefined values (i.e. -999).</p>
  
  <p>My desire output is:</p>
  
  <pre><code>ofile.txt
  6
  1
  3
  24
  -999
  -999
  0
  2
  2
  4
  4
  0
  -999
  -999
  -999
  -999
  12
  1
  2
  </code></pre>
  
  <p>I am trying with <code>awk'{(if $1 != -999 &amp;&amp; [$1] &gt;= [$2]),printf "%s\n",$1-$2}' ifile.txt</code></p>