<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: awk query in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131105#M153045</link>
    <description>for more on printf&lt;BR /&gt;&lt;BR /&gt;man printf&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jean-Luc</description>
    <pubDate>Fri, 28 Nov 2003 09:10:33 GMT</pubDate>
    <dc:creator>Jean-Luc Oudart</dc:creator>
    <dc:date>2003-11-28T09:10:33Z</dc:date>
    <item>
      <title>awk query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131102#M153042</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I want to total up the 5th Column of a text file. However, the total being printed is not printing/displaying in the correct format..I think my total is working fine but my printf is missing something..as follows:&lt;BR /&gt;cat $TRAFFIC | awk '{t1 +=$5}&lt;BR /&gt;END {printf("TRAFFIC TOTAL: "t1"")}' &amp;gt;&amp;gt; $TRAFFIC&lt;BR /&gt;&lt;BR /&gt;Printf outputs as follows: e.g.&lt;BR /&gt;TRAFFIC TOTAL: 5.97367e+06&lt;BR /&gt;&lt;BR /&gt;I think this is because the total will be quite a large number...I don't know how to display this correctly..?&lt;BR /&gt;&lt;BR /&gt;Also, I want to convert &amp;amp; display this value from bytes into kb's &amp;amp; mb's...Any easy method anyone?&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Nov 2003 09:04:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131102#M153042</guid>
      <dc:creator>Declan Mc Kay</dc:creator>
      <dc:date>2003-11-28T09:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: awk query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131103#M153043</link>
      <description>You could try:&lt;BR /&gt;printf("Traffic total: %d",t1);&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Nov 2003 09:06:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131103#M153043</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-11-28T09:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: awk query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131104#M153044</link>
      <description>try&lt;BR /&gt;printf("TRAFFIC TOTAL %12d\n",t1)&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Fri, 28 Nov 2003 09:07:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131104#M153044</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-11-28T09:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: awk query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131105#M153045</link>
      <description>for more on printf&lt;BR /&gt;&lt;BR /&gt;man printf&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Fri, 28 Nov 2003 09:10:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131105#M153045</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-11-28T09:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: awk query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131106#M153046</link>
      <description>You need something like&lt;BR /&gt; &lt;BR /&gt; printf "TRAFFIC CONTROL %ld",t1&lt;BR /&gt; &lt;BR /&gt;The simplest way to get your other answers is to divide by 1024 :)</description>
      <pubDate>Fri, 28 Nov 2003 09:13:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131106#M153046</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-11-28T09:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: awk query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131107#M153047</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you use printf, but provide no format string to format the number. You can print with or without leading zero and formatted to a specified number of digits.&lt;BR /&gt;&lt;BR /&gt;{printf("Total %09d \n",t1)}&lt;BR /&gt;&lt;BR /&gt;Nine digits with leading zeroes and newline.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Nov 2003 09:13:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-query/m-p/3131107#M153047</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-11-28T09:13:40Z</dc:date>
    </item>
  </channel>
</rss>

