<p>No response? Really? It was perfect, BTW.</p>
<div class="gmail_quote">On Feb 3, 2012 6:37 PM, "Richard Bronosky" <<a href="mailto:Richard@bronosky.com">Richard@bronosky.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Close but you ignited the math in the requirements.</p>
<p>Here us the answer:<br>
awk '{prev=last; last=$2} END {print (last-prev)/prev}' filename </p>
<p>This is untested because I wrote it on a phone.</p>
<p>On Feb 3, 2012 4:26 PM, "Erik Mathis" <<a href="mailto:erik@mathists.com" target="_blank">erik@mathists.com</a>> wrote:<br>
><br>
> awk '{sum+=$2} END {print sum}' filename<br>
> 310<br>
> awk '{subt-=$2} END {print subt}' filename<br>
> -310<br>
><br>
> Stolen and hacked from <a href="http://www.commandlinefu.com" target="_blank">http://www.commandlinefu.com</a><br>
><br>
> -Erik-<br>
><br>
> On Fri, Feb 3, 2012 at 1:51 PM, Randy Ramsdell <<a href="mailto:rramsdell@activedg.com" target="_blank">rramsdell@activedg.com</a>> wrote:<br>
> > I need to parse a file and then subtract next to last line field $2<br>
> > from the last line field $2 using awk and then convert this number to a<br>
> > percent.<br>
> ><br>
> > Data:<br>
> ><br>
> > $date 100<br>
> > $date 103<br>
> > $date 107<br>
> ><br>
> > So ... ( 107 - 103 ) / 103 ...<br>
> ><br>
> > Clues?<br>
> > _______________________________________________<br>
> > Ale mailing list<br>
> > <a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
> > <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
> > See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> > <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
> _______________________________________________<br>
> Ale mailing list<br>
> <a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
> <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
> See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</p>
</blockquote></div>