<?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/perl help. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703250#M249740</link>
    <description>I got it to working with following code. I would still like to get rid off second column.&lt;BR /&gt;&lt;BR /&gt;awk '/^[0-9][0-9&lt;BR /&gt;]:/{t=$1} /avserv$/;{if (NR==1 || (NF==8 &amp;amp;&amp;amp; $(NF-1)&amp;gt;250) || (NF==7 &amp;amp;&amp;amp;  $(NF-1)&amp;gt;250)) print t,$0}' xyz</description>
    <pubDate>Fri, 06 Jan 2006 01:52:33 GMT</pubDate>
    <dc:creator>RAC_1</dc:creator>
    <dc:date>2006-01-06T01:52:33Z</dc:date>
    <item>
      <title>awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703234#M249724</link>
      <description>Putting it here to get more responses. I need perl/awk help from you guys. simple, but proving to be difficult for me.&lt;BR /&gt;&lt;BR /&gt;HP-UX xxxyyy B.11.11 U 9000/800    01/05/06&lt;BR /&gt;&lt;BR /&gt;03:32:24   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;03:32:25   c1t2d0   11.88    0.50      21      97    4.35   10.33&lt;BR /&gt;           c2t2d0   10.89    0.50      19      89    4.50    7.35&lt;BR /&gt;           c4t3d0    0.99    0.50       1      16    2.89   16.59&lt;BR /&gt;           c4t4d0    0.99    0.50       1      16    2.90   12.09&lt;BR /&gt;           c4t5d0    0.99    0.50       1      16    1.53    9.00&lt;BR /&gt;           c5t5d0    0.99    0.50       1      16    1.54   11.23&lt;BR /&gt;          c12t0d3    0.99    0.50       7     453    6.54    1.62&lt;BR /&gt;          c13t0d4  100.00    0.50       1       2    4.64    0.49&lt;BR /&gt;          c12t1d4    0.99    0.50       7     137    3.20    1.13&lt;BR /&gt;          c12t0d0    1.98    0.50      33     507    5.08    0.60&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have following output (from sar -f) I need to get output based on following criteria.&lt;BR /&gt;&lt;BR /&gt;Print a record if (last second last column (avwait) is more than aserver (last column))&lt;BR /&gt;further, %busy is more than 60.&lt;BR /&gt;&lt;BR /&gt;I tried following, but not getting what I want.&lt;BR /&gt;cat "xxx" |Average"|awk '{if (($1~":") &amp;amp;&amp;amp; ($3&amp;gt;60) &amp;amp;&amp;amp; $((NF-1))&amp;gt;$NF) print $0;else if (($1!~":") &amp;amp;&amp;amp; ($2&amp;gt;60) &amp;amp;&amp;amp; $((NF-1))&amp;gt;$NF) print $0;else print "" ;}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I should get only following lines.&lt;BR /&gt;&lt;BR /&gt;03:32:24   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;c13t0d4  100.00    0.50       1       2    4.64    0.49&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jan 2006 04:39:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703234#M249724</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-05T04:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703235#M249725</link>
      <description>where are those scripting wizards??</description>
      <pubDate>Thu, 05 Jan 2006 05:11:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703235#M249725</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-05T05:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703236#M249726</link>
      <description>RAC,&lt;BR /&gt;is the output not correct?&lt;BR /&gt;The only record with %busy &amp;gt; 60 is record 8 (c13t0d4)&lt;BR /&gt;I copied the data into file xxx ,copied your statement into a sh and changed&lt;BR /&gt;the beginning to&lt;BR /&gt;cat xxx | awk ...&lt;BR /&gt;and got &lt;BR /&gt;c13t0d4 100.00 0.50 1 2 4.64 0.49&lt;BR /&gt;&lt;BR /&gt;What are you getting as output ?</description>
      <pubDate>Thu, 05 Jan 2006 06:14:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703236#M249726</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-01-05T06:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703237#M249727</link>
      <description>Simple :) :)&lt;BR /&gt;&lt;BR /&gt;lt09:/home/merijn 103 &amp;gt; cat xx.txt&lt;BR /&gt;03:32:24 device %busy avque r+w/s blks/s avwait avserv&lt;BR /&gt;03:32:25 c1t2d0 11.88 0.50 21 97 4.35 10.33&lt;BR /&gt;c2t2d0 10.89 0.50 19 89 4.50 7.35&lt;BR /&gt;c4t3d0 0.99 0.50 1 16 2.89 16.59&lt;BR /&gt;c4t4d0 0.99 0.50 1 16 2.90 12.09&lt;BR /&gt;c4t5d0 0.99 0.50 1 16 1.53 9.00&lt;BR /&gt;c5t5d0 0.99 0.50 1 16 1.54 11.23&lt;BR /&gt;c12t0d3 0.99 0.50 7 453 6.54 1.62&lt;BR /&gt;c13t0d4 100.00 0.50 1 2 4.64 0.49&lt;BR /&gt;c12t1d4 0.99 0.50 7 137 3.20 1.13&lt;BR /&gt;lt09:/home/merijn 104 &amp;gt; perl -nae'$F[-2]&amp;gt;=$F[-1]&amp;amp;&amp;amp;$F[2]&amp;gt;=.6 and print' xx.txt&lt;BR /&gt;lt09:/home/merijn 105 &amp;gt; perl -nae'$F[-2]&amp;gt;=$F[-1]&amp;amp;&amp;amp;$F[2]&amp;gt;=.5 and print' xx.txt&lt;BR /&gt;c12t0d3 0.99 0.50 7 453 6.54 1.62&lt;BR /&gt;c13t0d4 100.00 0.50 1 2 4.64 0.49&lt;BR /&gt;c12t1d4 0.99 0.50 7 137 3.20 1.13&lt;BR /&gt;lt09:/home/merijn 106 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 05 Jan 2006 06:19:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703237#M249727</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-01-05T06:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703238#M249728</link>
      <description>Small change, as I took the headers of the first line to the meaning of the columns&lt;BR /&gt;&lt;BR /&gt;lt09:/home/merijn 102 &amp;gt; perl -nae'$F[-2]&amp;gt;=$F[-1]&amp;amp;&amp;amp;$F[1]&amp;gt;=60 and print' xx.txt&lt;BR /&gt;c13t0d4 100.00 0.50 1 2 4.64 0.49&lt;BR /&gt;lt09:/home/merijn 103 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 05 Jan 2006 06:46:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703238#M249728</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2006-01-05T06:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703239#M249729</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt;I am not getting correct output with my awk command. I also need to get following lines.&lt;BR /&gt;&lt;BR /&gt;00:00:00   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;&lt;BR /&gt;and first line in output.&lt;BR /&gt;&lt;BR /&gt;these two lines have timestamp, which is required to associate that data with time when it happened.&lt;BR /&gt;&lt;BR /&gt;Procura,&lt;BR /&gt;&lt;BR /&gt;How to include above requirement in perl statement?</description>
      <pubDate>Thu, 05 Jan 2006 22:01:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703239#M249729</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-05T22:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703240#M249730</link>
      <description>&lt;BR /&gt;perl -nae'/avserv/ || $F[-2]&amp;gt;=$F[-1]&amp;amp;&amp;amp;$F[1]&amp;gt;=60 and print' x&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;awk '/avserv$/; /^c/{if ($2&amp;gt;60 &amp;amp;&amp;amp; $(NF-1) &amp;gt; $NF)print}' x&lt;BR /&gt;&lt;BR /&gt;but... &lt;BR /&gt;&lt;BR /&gt;What is that "03:32:25" on the line with "c1t2d0"?&lt;BR /&gt;Is that for real or cut&amp;amp;paste thing?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jan 2006 22:29:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703240#M249730</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-01-05T22:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703241#M249731</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;From following output, &lt;BR /&gt;21:35:23   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;21:35:24   c1t2d0    7.84    0.50      14      71    4.53    8.56&lt;BR /&gt;           c2t2d0    8.82    0.50      12      63    4.33    8.12&lt;BR /&gt;           c4t3d0    5.88    0.50       5      78    7.58   12.60&lt;BR /&gt;           c4t4d0    4.90    0.50       4      63    7.46   14.34&lt;BR /&gt;           c4t5d0    0.98    0.50       3      63    6.46    4.13&lt;BR /&gt;           c5t5d0    0.98    0.50       2      47    6.04    7.54&lt;BR /&gt;           c5t6d0    1.96    0.50       1      16    6.82   13.69&lt;BR /&gt;          c12t0d4    1.96   20.96      77     700    9.19    0.78&lt;BR /&gt;          c13t0d4   99.02    0.50       1       2    3.58    0.07&lt;BR /&gt;          c12t1d4    1.96    0.50       7     135    4.67    2.37&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I want,&lt;BR /&gt;&lt;BR /&gt;21:35:23   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;21:35:24   c1t2d0    7.84    0.50      14      71    4.53    8.56&lt;BR /&gt;          c13t0d4   99.02    0.50       1       2    3.58    0.07&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Because, first two lines have timestamp and last line has %busy greater than 60 and avwait is more than avserv.&lt;BR /&gt;&lt;BR /&gt;Your awk statement greps only first line.</description>
      <pubDate>Thu, 05 Jan 2006 22:37:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703241#M249731</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-05T22:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703242#M249732</link>
      <description>I did not have a system with sar handy when I replied just now. After a quick google I see there is a time stamp per list of records. What I now think you want is:&lt;BR /&gt;&lt;BR /&gt;$ perl -nae'print if /avserv$/; $t=$1 if (/^(\d+:\d+:\d+)/); $F[-2]&amp;gt;=$F[-1]&amp;amp;&amp;amp;$F[-6]&amp;gt;=60 and print "$t $_"' x&lt;BR /&gt;03:32:24 device %busy avque r+w/s blks/s avwait avserv&lt;BR /&gt;03:32:25 c13t0d4 100.00 0.50 1 2 4.64 0.49&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;$ awk '/^[0-9][0-9]:/{t=$1} /avserv$/; /^c/{if ($2&amp;gt;60 &amp;amp;&amp;amp; $(NF-1) &amp;gt; $NF)print t,$0}' x&lt;BR /&gt;03:32:24 device %busy avque r+w/s blks/s avwait avserv&lt;BR /&gt;03:32:25 c13t0d4 100.00 0.50 1 2 4.64 0.49&lt;BR /&gt;&lt;BR /&gt;In both cases I load a variable 't' with the last timestamp seen where timestamp is recognized by soem decimals and colon at the begin of a line. I then print that last 't' seen along with any line matching the other criteria.&lt;BR /&gt;&lt;BR /&gt;btw... Next time please attach a .txt file with the exact sample input data, and a sample of the desired output because the forum text mangles whitespace. It also prevents idle speculation, and re-replies about exactly what was requested.&lt;BR /&gt;&lt;BR /&gt;Also, for your other  question: &lt;BR /&gt;"Jan 5, 2006 10:11:12 GMT    N/A: Question Author   &lt;BR /&gt;----------------------------------------&lt;BR /&gt;where are those scripting wizards?? "&lt;BR /&gt;&lt;BR /&gt;I think the answer is: "in bed in the USA"&lt;BR /&gt;Fortunately the UK, and the Netherland were present and awake.&lt;BR /&gt;:-)&lt;BR /&gt;&lt;BR /&gt;Happy New Year,&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jan 2006 22:58:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703242#M249732</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-01-05T22:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703243#M249733</link>
      <description>perl solution works, but not awk.&lt;BR /&gt;&lt;BR /&gt;Can you check??&lt;BR /&gt;&lt;BR /&gt;thank you for your help.</description>
      <pubDate>Thu, 05 Jan 2006 23:03:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703243#M249733</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-05T23:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703244#M249734</link>
      <description>&amp;gt;&amp;gt; Can you check??&lt;BR /&gt;&lt;BR /&gt;Not without the attached file .txt with&lt;BR /&gt;- sample input.&lt;BR /&gt;- an indication how it failed.&lt;BR /&gt;&lt;BR /&gt;As I showed, the awk worked for me... albeit on a linux box (my CD player :-).&lt;BR /&gt;The hpux awk may need some more parens or curly brackets....&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Jan 2006 23:19:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703244#M249734</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-01-05T23:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703245#M249735</link>
      <description>Attaching a file here. Need hp-ux awk solution.</description>
      <pubDate>Thu, 05 Jan 2006 23:28:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703245#M249735</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-05T23:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703246#M249736</link>
      <description>Attaching a file here. Need hp-ux awk solution.</description>
      <pubDate>Thu, 05 Jan 2006 23:40:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703246#M249736</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-05T23:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703247#M249737</link>
      <description>You can try the following ...&lt;BR /&gt;&lt;BR /&gt;awk '{if (NR==1 || (NF==8 &amp;amp;&amp;amp; $3&amp;gt;60 &amp;amp;&amp;amp; $(NF-1)&amp;gt;$NF) || (NF==7 &amp;amp;&amp;amp; $2&amp;gt;60 &amp;amp;&amp;amp; $(NF-1)&amp;gt;$NF)) print}' testfile</description>
      <pubDate>Fri, 06 Jan 2006 00:44:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703247#M249737</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2006-01-06T00:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703248#M249738</link>
      <description>Ermin,&lt;BR /&gt;&lt;BR /&gt;This works except that, I would like to have time stap at every record. (This timestamp would last encountered time stamp)&lt;BR /&gt;&lt;BR /&gt;00:00:00   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;          c12t0d4    0.58  134.53      17     165   22.34    1.44&lt;BR /&gt;          c12t0d4    1.67  220.65      15     138  231.37    6.85&lt;BR /&gt;          c12t0d4    0.98  104.79      21     184   25.27    1.36&lt;BR /&gt;           c4t5d0   11.82    6.74      15     210   28.56   16.03&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Should be as follows.&lt;BR /&gt;00:00:00   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;00:00:00 c12t0d4    0.58  134.53      17     165   22.34    1.44&lt;BR /&gt;00:00:00          c12t0d4    1.67  220.65      15     138  231.37    6.85</description>
      <pubDate>Fri, 06 Jan 2006 00:55:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703248#M249738</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-06T00:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703249#M249739</link>
      <description>As i suspected. My example failed because the actual data did not match the forum presenation which had stripped leading spaces. I tested for datalines looking for the a 'c' in the first position.&lt;BR /&gt;&lt;BR /&gt;The variable field count can be solved by workign from teh right, as per my perl example.&lt;BR /&gt;&lt;BR /&gt;The awk solution also needs to be improved by checking for more than 5 fields on a line.&lt;BR /&gt;&lt;BR /&gt;Here a slightly different awk approach which I think will work for you: Once you replace the '^ ' by a '^' followed by 8 spaces.&lt;BR /&gt;&lt;BR /&gt;awk '/^[0-9][0-9]:/{t=$1} /avserv$/; {if (NF&amp;gt;5 &amp;amp;&amp;amp; $(NF-5)&amp;gt;60 &amp;amp;&amp;amp; $(NF-1) &amp;gt; $NF){sub(/^        /,t,$0); print}}' xx&lt;BR /&gt;&lt;BR /&gt;1) pick up timestamp into t, if you see one.&lt;BR /&gt;2) if you see a header line, do the default which is print.&lt;BR /&gt;3) if there are enough fields, and the 2 main test succeed then do 4&lt;BR /&gt;4) substitute any leading blanks if present by the last timestamp and print.&lt;BR /&gt;&lt;BR /&gt;NOTE AGAIN: The /^ / is actually a series of 8 spaces!&lt;BR /&gt;&lt;BR /&gt;Result:&lt;BR /&gt;22:24:18   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;22:24:19   c1t2d0   64.95    0.50       6      40    16.64   9.86&lt;BR /&gt;22:24:19   c4t5d0   65.45    0.50      76    1248    15.32    8.39&lt;BR /&gt;&lt;BR /&gt;Now if you really do not want the duplicate timestamp then change to &lt;BR /&gt;&lt;BR /&gt;awk '/^[0-9][0-9]:/{t=$1} /avserv$/; {if (NF&amp;gt;5 &amp;amp;&amp;amp; $(NF-5)&amp;gt;60 &amp;amp;&amp;amp; $(NF-1) &amp;gt; $NF){sub(/^        /,t,$0); print; t="        "}}' xx&lt;BR /&gt;22:24:18   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;22:24:19   c1t2d0   64.95    0.50       6      40    16.64   9.86&lt;BR /&gt;           c4t5d0   65.45    0.50      76    1248    15.32    8.39&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ONCE AGAIN: The quoted space is really 8 spaces, both in the sub regexpr and in the reset.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jan 2006 01:26:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703249#M249739</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-01-06T01:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703250#M249740</link>
      <description>I got it to working with following code. I would still like to get rid off second column.&lt;BR /&gt;&lt;BR /&gt;awk '/^[0-9][0-9&lt;BR /&gt;]:/{t=$1} /avserv$/;{if (NR==1 || (NF==8 &amp;amp;&amp;amp; $(NF-1)&amp;gt;250) || (NF==7 &amp;amp;&amp;amp;  $(NF-1)&amp;gt;250)) print t,$0}' xyz</description>
      <pubDate>Fri, 06 Jan 2006 01:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703250#M249740</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2006-01-06T01:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703251#M249741</link>
      <description>Hmm, That looks like a difference selection  allt ogether.&lt;BR /&gt;&lt;BR /&gt;anyway, re-read my prior reply. It solves the extra column.&lt;BR /&gt;&lt;BR /&gt;also... please note the discrapency between the request in the attachment (no timestamp on second line) and later replies. That does not make it any easier to try to help.&lt;BR /&gt;&lt;BR /&gt;cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Jan 2006 07:42:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703251#M249741</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-01-06T07:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703252#M249742</link>
      <description>Hey;&lt;BR /&gt;&lt;BR /&gt;Just to add my $.02... Attached is a perl script that will parse sar binary files and filter the output based on command line args:&lt;BR /&gt;&lt;BR /&gt;-f ${file}   # Sar file to process - defaults to today.&lt;BR /&gt;-d ${device} # Device to scan for  - no default.&lt;BR /&gt;-p ${perc}   # Percent busy        - no default.&lt;BR /&gt;-q ${queue}  # Average queue       - no default.&lt;BR /&gt;-b ${blocks} # Blocks/sec          - no default.&lt;BR /&gt;-w ${avgwio} # Average wio         - defaults to 100ms&lt;BR /&gt;-s ${avserv} # Average svc time    - no default.&lt;BR /&gt;&lt;BR /&gt;HTH;&lt;BR /&gt;&lt;BR /&gt;Doug</description>
      <pubDate>Fri, 06 Jan 2006 08:34:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703252#M249742</guid>
      <dc:creator>Doug O'Leary</dc:creator>
      <dc:date>2006-01-06T08:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: awk/perl help.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703253#M249743</link>
      <description>RAC,&lt;BR /&gt;&lt;BR /&gt;Based on your input file here's a short awk construct that will do the job:&lt;BR /&gt;&lt;BR /&gt;# awk '{if((NR==1) || $(NF-1)&amp;gt;$NF &amp;amp;&amp;amp; $(NF-5)&amp;gt;60) print $0}' &lt;INPUT_FILE&gt;&lt;BR /&gt;&lt;BR /&gt;FYI...pasted below is the input file I used&lt;BR /&gt;=============================================&lt;BR /&gt;22:24:18   device   %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;22:24:19   c1t2d0   64.95    0.50       6      40    16.64   9.86&lt;BR /&gt;           c2t2d0    2.97    0.50       4      32    7.02    8.87&lt;BR /&gt;           c4t3d0    0.99    0.50       1      16    8.56    8.40&lt;BR /&gt;           c4t4d0    0.99    0.50       1      16    8.58    8.08&lt;BR /&gt;           c4t5d0   65.45    0.50      76    1248    15.32    8.39&lt;BR /&gt;           c5t5d0   44.55    0.50      70    1141    4.97    6.52&lt;BR /&gt;=============================================&lt;BR /&gt;&lt;BR /&gt;cheers!&lt;/INPUT_FILE&gt;</description>
      <pubDate>Fri, 06 Jan 2006 13:26:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-perl-help/m-p/3703253#M249743</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-01-06T13:26:59Z</dc:date>
    </item>
  </channel>
</rss>

