<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”.&nbsp;&nbsp; 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>&nbsp;</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">&nbsp;</p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5">&nbsp;</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>&nbsp;</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, &quot;Geoffrey Myers&quot; &lt;<a href="mailto:lists@serioustechnology.com" moz-do-not-send="true">lists@serioustechnology.com</a>&gt; 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>
&gt; awk '{sum&#43;=$2} END {print sum}' filename<br>
&gt; 310<br>
&gt; awk '{subt-=$2} END {print subt}' filename<br>
&gt; -310<br>
<br>
Seems to me that will total all the records. &nbsp;The OP only want's the<br>
last two as I recall.<br>
<br>
&gt;<br>
&gt; Stolen and hacked from <a href="http://www.commandlinefu.com" target="_blank" moz-do-not-send="true">
http://www.commandlinefu.com</a><br>
&gt;<br>
&gt; -Erik-<br>
&gt;<br>
&gt; On Fri, Feb 3, 2012 at 1:51 PM, Randy Ramsdell &lt;<a href="mailto:rramsdell@activedg.com" moz-do-not-send="true">rramsdell@activedg.com</a>&gt; wrote:<br>
&gt;&gt; I need to parse a file and then subtract next to last line field $2<br>
&gt;&gt; from the last line field $2 using awk and then convert this number to a<br>
&gt;&gt; percent.<br>
&gt;&gt;<br>
&gt;&gt; Data:<br>
&gt;&gt;<br>
&gt;&gt; $date 100<br>
&gt;&gt; $date 103<br>
&gt;&gt; $date 107<br>
&gt;&gt;<br>
&gt;&gt; So ... ( 107 - 103 ) / 103 ...<br>
&gt;&gt;<br>
&gt;&gt; Clues?<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Ale mailing list<br>
&gt;&gt; <a href="mailto:Ale@ale.org" moz-do-not-send="true">Ale@ale.org</a><br>
&gt;&gt; <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>
&gt;&gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt;&gt; <a href="http://mail.ale.org/mailman/listinfo" target="_blank" moz-do-not-send="true">
http://mail.ale.org/mailman/listinfo</a><br>
&gt; _______________________________________________<br>
&gt; Ale mailing list<br>
&gt; <a href="mailto:Ale@ale.org" moz-do-not-send="true">Ale@ale.org</a><br>
&gt; <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>
&gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt; <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>
&quot;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.&quot;<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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</p>
<p class="9c5b04f2-d7f2-4162-8c45-8f717dee1be5">&nbsp;</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>&nbsp;</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>&nbsp;</p>
</body>
</html>