<?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 Script Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168888#M160941</link>
    <description>Start simple and then you can build on this:&lt;BR /&gt;get F+G&lt;BR /&gt;awk "/total/ { print $6+$7 }" inputFile&lt;BR /&gt;Get H&lt;BR /&gt;awk "/total/ { print $8 }" inputfile&lt;BR /&gt;and you can combine them into a file (x1 say):&lt;BR /&gt;/total/ { print $6+$7 }&lt;BR /&gt;/total/ { print $8 }&lt;BR /&gt;&lt;BR /&gt;and then use it &lt;BR /&gt;awk -f x1 inputFile&lt;BR /&gt;&lt;BR /&gt;where inputFile is the file that contains your&lt;BR /&gt;original info.&lt;BR /&gt;&lt;BR /&gt;Play with that and you can learn awk on the way.&lt;BR /&gt;&lt;BR /&gt;HTH       ...Laurie :{)</description>
    <pubDate>Tue, 20 Jan 2004 16:47:07 GMT</pubDate>
    <dc:creator>Laurie Gellatly</dc:creator>
    <dc:date>2004-01-20T16:47:07Z</dc:date>
    <item>
      <title>Awk Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168887#M160940</link>
      <description>Hi Masters,&lt;BR /&gt;    Please help me to write a shell script to get the desired output as described below:&lt;BR /&gt;Input file content:&lt;BR /&gt;&lt;BR /&gt;call     count       cpu    elapsed       disk      query    current        rows&lt;BR /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;BR /&gt;Parse        D      0.01       0.02          0          0          0           0&lt;BR /&gt;Execute      E      0.00       0.00          0          0          0           0&lt;BR /&gt;Fetch        J      1.31       1.58       2169       6951         36           I &lt;BR /&gt;------- ------  -------- ---------- ---------- ---------- ----------  ----------&lt;BR /&gt;total       45      1.32       1.60          K          F          G           H&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Desired Output:&lt;BR /&gt;&lt;BR /&gt;I want to display following ratios using "AWK"&lt;BR /&gt;i. F+G&lt;BR /&gt;   F+G&lt;BR /&gt;2. ---&lt;BR /&gt;    H&lt;BR /&gt;&lt;BR /&gt;3. D/E&lt;BR /&gt;&lt;BR /&gt;4. I/J&lt;BR /&gt;5. K&lt;BR /&gt;  ----&lt;BR /&gt;  F+G  &lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;Points will be awarded.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jan 2004 13:30:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168887#M160940</guid>
      <dc:creator>Ashwin_4</dc:creator>
      <dc:date>2004-01-20T13:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168888#M160941</link>
      <description>Start simple and then you can build on this:&lt;BR /&gt;get F+G&lt;BR /&gt;awk "/total/ { print $6+$7 }" inputFile&lt;BR /&gt;Get H&lt;BR /&gt;awk "/total/ { print $8 }" inputfile&lt;BR /&gt;and you can combine them into a file (x1 say):&lt;BR /&gt;/total/ { print $6+$7 }&lt;BR /&gt;/total/ { print $8 }&lt;BR /&gt;&lt;BR /&gt;and then use it &lt;BR /&gt;awk -f x1 inputFile&lt;BR /&gt;&lt;BR /&gt;where inputFile is the file that contains your&lt;BR /&gt;original info.&lt;BR /&gt;&lt;BR /&gt;Play with that and you can learn awk on the way.&lt;BR /&gt;&lt;BR /&gt;HTH       ...Laurie :{)</description>
      <pubDate>Tue, 20 Jan 2004 16:47:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168888#M160941</guid>
      <dc:creator>Laurie Gellatly</dc:creator>
      <dc:date>2004-01-20T16:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168889#M160942</link>
      <description>Sorry, but the desired output formatting is unclear to me. Still, I'm sure you can get going using the following:&lt;BR /&gt;&lt;BR /&gt;# cat x.awk&lt;BR /&gt;/^Par/{ d = $2}&lt;BR /&gt;/^Exe/{ e = $2}&lt;BR /&gt;/^Fet/{ j = $2}&lt;BR /&gt;/^tot/{ k = $5; f = $6; g = $7; h  = $8;&lt;BR /&gt;        print d,e,j,k,f,g,h;&lt;BR /&gt;        }&lt;BR /&gt;END { printf "(could be part of total processing) D/E = %5.2f%%\n",100*d/e }&lt;BR /&gt;&lt;BR /&gt;# cat x&lt;BR /&gt;call count cpu elapsed disk query current rows&lt;BR /&gt;------- ------ -------- ---------- ---------- ---------- ---------- ----------&lt;BR /&gt;Parse 1 0.01 0.02 0 0 0 0&lt;BR /&gt;Execute 3 0.00 0.00 0 0 0 0&lt;BR /&gt;Fetch J 1.31 1.58 2169 6951 36 I&lt;BR /&gt;------- ------ -------- ---------- ---------- ---------- ---------- ----------&lt;BR /&gt;total 45 1.32 1.60 K F G H&lt;BR /&gt;&lt;BR /&gt;# awk -f x.awk &amp;lt; x&lt;BR /&gt;1 3 J K F G H&lt;BR /&gt;(could be part of total processing) D/E = 33.33%&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy...&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jan 2004 17:20:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168889#M160942</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-01-20T17:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Script Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168890#M160943</link>
      <description>awk '&lt;BR /&gt;/^Parse/ { d = $2;}&lt;BR /&gt;/^Execute/ { e = $2;}&lt;BR /&gt;/^Fetch/ { j = $2;&lt;BR /&gt;           i = $9; }&lt;BR /&gt;/^total/ { f = $6;&lt;BR /&gt;           g = $7;&lt;BR /&gt;           h = $8;&lt;BR /&gt;           k = $5; }&lt;BR /&gt;END {&lt;BR /&gt;printf("f+g = %d\n",f+g);&lt;BR /&gt;printf("(f+g)/h = %d\n",(f+g)/h);&lt;BR /&gt;...&lt;BR /&gt;}'</description>
      <pubDate>Tue, 20 Jan 2004 17:21:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-script-help/m-p/3168890#M160943</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2004-01-20T17:21:47Z</dc:date>
    </item>
  </channel>
</rss>

