<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Haven't had time to work on this. Spent much time on it and had to
move on. Thanks for the replies so far. Now I just have to think
'floating point' but will at least get the formula down. I was
simply trying to do this all in awk instead of the pipe everything
to another program to handle the respective pieces. <br>
<br>
On 02/07/2012 07:31 AM, Richard Bronosky wrote:
<blockquote
cite="mid:CAAjbB_4uUhV5-Vs6eH4hyG3sGzKqyZbQDXY77=kGi0y+Eh1ynQ@mail.gmail.com"
type="cite">
<p>You are right. That is why I sent my reply with the correct
solution. I was thinking that my emails were not getting to the
list until Jim replied to a post I made on another thread.</p>
<div class="gmail_quote">On Feb 6, 2012 2:55 PM, "Geoffrey Myers"
<<a moz-do-not-send="true"
href="mailto:lists@serioustechnology.com">lists@serioustechnology.com</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Erik Mathis wrote:<br>
> awk '{sum+=$2} END {print sum}' filename<br>
> 310<br>
> awk '{subt-=$2} END {print subt}' filename<br>
> -310<br>
<br>
Seems to me that will total all the records. The OP only
want's the<br>
last two as I recall.<br>
<br>
><br>
> Stolen and hacked from <a moz-do-not-send="true"
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
moz-do-not-send="true" href="mailto:rramsdell@activedg.com">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 moz-do-not-send="true" href="mailto:Ale@ale.org">Ale@ale.org</a><br>
>> <a moz-do-not-send="true"
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 moz-do-not-send="true"
href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
> _______________________________________________<br>
> Ale mailing list<br>
> <a moz-do-not-send="true" href="mailto:Ale@ale.org">Ale@ale.org</a><br>
> <a moz-do-not-send="true"
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 moz-do-not-send="true"
href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br>
<br>
--<br>
Until later, Geoffrey<br>
<br>
"I predict future happiness for America if they can prevent<br>
the government from wasting the labors of the people under<br>
the pretense of taking care of them."<br>
- Thomas Jefferson<br>
_______________________________________________<br>
Ale mailing list<br>
<a moz-do-not-send="true" href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a moz-do-not-send="true"
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 moz-do-not-send="true"
href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Ale mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Ale@ale.org">Ale@ale.org</a>
<a class="moz-txt-link-freetext" href="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</a>
See JOBS, ANNOUNCE and SCHOOLS lists at
<a class="moz-txt-link-freetext" href="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</a>
</pre>
</blockquote>
<br>
</body>
</html>