<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<!-- Template generated by Exclaimer Mail Disclaimers on 09:07:11 Tuesday, 7 February 2012 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">P.9c5b04f2-d7f2-4162-8c45-8f717dee1be5 {
        MARGIN: 0cm 0cm 0pt
}
LI.9c5b04f2-d7f2-4162-8c45-8f717dee1be5 {
        MARGIN: 0cm 0cm 0pt
}
DIV.9c5b04f2-d7f2-4162-8c45-8f717dee1be5 {
        MARGIN: 0cm 0cm 0pt
}
TABLE.9c5b04f2-d7f2-4162-8c45-8f717dee1be5Table {
        MARGIN: 0cm 0cm 0pt
}
DIV.Section1 {
        page: Section1
}
</style>
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="country-region" /><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place" /><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]--><style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="blue">
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"></p>
<div class="Section1">
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Any time I need to do floating point in a script I pipe it to “bc –l”. Maybe not the most elegant way to do things but it works.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt;color:windowtext"></span></font></div>
</div>
</div>
<p></p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"> </p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"> </p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"></p>
<div class="Section1">
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt;color:windowtext">
<hr size="2" width="100%" align="center" tabindex="-1">
</span></font></div>
<p class="MsoNormal"><b><font size="2" color="black" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;color:windowtext;font-weight:bold">From:</span></font></b><font size="2" color="black" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma;
color:windowtext">
ale-bounces@ale.org [mailto:ale-bounces@ale.org] <b><span style="font-weight:bold">On Behalf Of
</span></b>Randy Ramsdell<br>
<b><span style="font-weight:bold">Sent:</span></b> Tuesday, February 07, 2012 8:28 AM<br>
<b><span style="font-weight:bold">To:</span></b> ale@ale.org<br>
<b><span style="font-weight:bold">Subject:</span></b> Re: [ale] Awk question</span></font><font color="black"><span style="color:windowtext"><o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt">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: <o:p></o:p></span></font></p>
<p><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt">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.<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt">On Feb 6, 2012 2:55 PM, "Geoffrey Myers" <<a href="mailto:lists@serioustechnology.com" moz-do-not-send="true">lists@serioustechnology.com</a>> wrote:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt">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 href="http://www.commandlinefu.com" target="_blank" moz-do-not-send="true">
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" moz-do-not-send="true">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" moz-do-not-send="true">Ale@ale.org</a><br>
>> <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank" moz-do-not-send="true">
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" moz-do-not-send="true">
http://mail.ale.org/mailman/listinfo</a><br>
> _______________________________________________<br>
> Ale mailing list<br>
> <a href="mailto:Ale@ale.org" moz-do-not-send="true">Ale@ale.org</a><br>
> <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank" moz-do-not-send="true">
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" moz-do-not-send="true">
http://mail.ale.org/mailman/listinfo</a><br>
<br>
<br>
--<br>
Until later, Geoffrey<br>
<br>
"I predict future happiness for <st1:country-region w:st="on"><st1:place w:st="on">America</st1:place></st1:country-region> 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 href="mailto:Ale@ale.org" moz-do-not-send="true">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank" moz-do-not-send="true">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" moz-do-not-send="true">http://mail.ale.org/mailman/listinfo</a><o:p></o:p></span></font></p>
</div>
<pre wrap=""><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt"><o:p> </o:p></span></font></pre>
<pre><fieldset class="mimeAttachmentHeader"></fieldset><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt"><o:p> </o:p></span></font></pre>
<pre><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt">_______________________________________________<o:p></o:p></span></font></pre>
<pre><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt">Ale mailing list<o:p></o:p></span></font></pre>
<pre><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt"><a href="mailto:Ale@ale.org">Ale@ale.org</a><o:p></o:p></span></font></pre>
<pre><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt"><a href="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</a><o:p></o:p></span></font></pre>
<pre><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt">See JOBS, ANNOUNCE and SCHOOLS lists at<o:p></o:p></span></font></pre>
<pre><font size="2" color="black" face="Courier New"><span style="font-size:10.0pt"><a href="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</a><o:p></o:p></span></font></pre>
<p class="MsoNormal"><font size="3" color="black" face="Times New Roman"><span style="font-size:12.0pt"><o:p> </o:p></span></font></p>
</div>
<p></p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"><font face="Arial"><font color="fuchsia"><font style="FONT-FAMILY: Arial; FONT-SIZE: 10pt" size="2"></font></font></font> </p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"> </p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"><font face="Arial"><font color="fuchsia"><font style="FONT-FAMILY: Arial; FONT-SIZE: 10pt" size="2">Athena<font size="1">®</font>, Created for the Cause</font><font size="1">™
</font></font></font></p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"><font size="2" face="Arial">Making a Difference in the Fight Against Breast Cancer</font></p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"><span style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"></span> </p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5"><span style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">---------------------------------<br>
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information
is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.<br>
----------------------------------</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"><o:p></o:p></span></p>
<p> </p>
</body>
</html>