<?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 help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276826#M657372</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I've noticed that in all lines always appear "Agent Listener " before "RUNNING", so you can use it as field limiter. eg:&lt;BR /&gt;#cat sample.txt&lt;BR /&gt;Workflow Deferred Agent Listener RUNNING&lt;BR /&gt;Workflow Deferred Notification Agent Listener RUNNING&lt;BR /&gt;Workflow Error Agent Listener RUNNING&lt;BR /&gt;Workflow Inbound JMS Agent Listener RUNNING&lt;BR /&gt;Workflow Inbound Notifications Agent Listener RUNNING&lt;BR /&gt;Workflow Java Deferred Agent Listener RUNNING&lt;BR /&gt;Workflow Java Error Agent Listener RUNNING&lt;BR /&gt;&lt;BR /&gt;#cat sample.txt |awk -F"Agent Listener " '{ print $2 }'&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;&lt;BR /&gt;I hope it will be useful.&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
    <pubDate>Wed, 16 Mar 2011 07:17:49 GMT</pubDate>
    <dc:creator>Jose Mosquera</dc:creator>
    <dc:date>2011-03-16T07:17:49Z</dc:date>
    <item>
      <title>Awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276824#M657370</link>
      <description>Hi All,&lt;BR /&gt;sql statement returned 2 columns and i like to get the result of a second column " RUNNING" using awk '{print $2}'&lt;BR /&gt;&lt;BR /&gt;but because of space between the words. the result was not correct.&lt;BR /&gt; &lt;BR /&gt;Please give some suggestions on how to use "awk" or "cut" to get the result which is the &lt;BR /&gt;"RUNNING" &lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Workflow Deferred Agent Listener                RUNNING&lt;BR /&gt;Workflow Deferred Notification Agent Listener  RUNNING&lt;BR /&gt;Workflow Error Agent Listener                   RUNNING&lt;BR /&gt;Workflow Inbound JMS Agent Listener            RUNNING&lt;BR /&gt;Workflow Inbound Notifications Agent Listener  RUNNING&lt;BR /&gt;Workflow Java Deferred Agent Listener          RUNNING&lt;BR /&gt;Workflow Java Error Agent Listener              RUNNING&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Mar 2011 04:42:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276824#M657370</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2011-03-16T04:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276825#M657371</link>
      <description>&amp;gt;but because of space between the words. the result was not correct.&lt;BR /&gt;&lt;BR /&gt;You are going to have to provide more details of how the fields are defined.  Unless you always want the last column?&lt;BR /&gt;&lt;BR /&gt;You can use awk to print the last column, $NF.  And work backward, $(NF-1).&lt;BR /&gt;&lt;BR /&gt;Otherwise you may have to use advanced AI technology to determine where your fields begin and end.</description>
      <pubDate>Wed, 16 Mar 2011 07:06:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276825#M657371</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-16T07:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276826#M657372</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I've noticed that in all lines always appear "Agent Listener " before "RUNNING", so you can use it as field limiter. eg:&lt;BR /&gt;#cat sample.txt&lt;BR /&gt;Workflow Deferred Agent Listener RUNNING&lt;BR /&gt;Workflow Deferred Notification Agent Listener RUNNING&lt;BR /&gt;Workflow Error Agent Listener RUNNING&lt;BR /&gt;Workflow Inbound JMS Agent Listener RUNNING&lt;BR /&gt;Workflow Inbound Notifications Agent Listener RUNNING&lt;BR /&gt;Workflow Java Deferred Agent Listener RUNNING&lt;BR /&gt;Workflow Java Error Agent Listener RUNNING&lt;BR /&gt;&lt;BR /&gt;#cat sample.txt |awk -F"Agent Listener " '{ print $2 }'&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;RUNNING&lt;BR /&gt;&lt;BR /&gt;I hope it will be useful.&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
      <pubDate>Wed, 16 Mar 2011 07:17:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276826#M657372</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2011-03-16T07:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276827#M657373</link>
      <description>If you simply want the last item on each line:&lt;BR /&gt; &lt;BR /&gt;awk '{print $NF}' /tmp/mysql.out</description>
      <pubDate>Wed, 16 Mar 2011 10:29:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276827#M657373</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2011-03-16T10:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276828#M657374</link>
      <description>Tom,&lt;BR /&gt;You can try this,&lt;BR /&gt;&lt;BR /&gt;# awk '{for (i=0;i&amp;lt;=NF;++i) if ($i ~ "RUNNING") print $0 }' file&lt;BR /&gt;&lt;BR /&gt;It will print all the line contains RUNNING .&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Wed, 16 Mar 2011 10:52:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276828#M657374</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2011-03-16T10:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Awk help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276829#M657375</link>
      <description>&lt;BR /&gt;Thank you all for your helps.&lt;BR /&gt;Regards,&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Mar 2011 15:37:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/5276829#M657375</guid>
      <dc:creator>tom quach_1</dc:creator>
      <dc:date>2011-03-16T15:37:38Z</dc:date>
    </item>
  </channel>
</rss>

