<?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 processing in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151709#M683797</link>
    <description>I meant to carry the hunter/gatherer metaphor further. Hunt for match candidates, gather droppings,... :-)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; I'll have a look at what I can come up with&lt;BR /&gt;&lt;BR /&gt;It should already work. &lt;BR /&gt;If it does not, then that's probably because the forum ate spaces.&lt;BR /&gt;I like using 'anchors' in my search strings, whether they are strictly needed or not, to prevent stray matches and to speed up misses. Here I used "^" to anchor to the begin of line... but that only works as written when there are no leading spaces.&lt;BR /&gt;&lt;BR /&gt;If you have trouble with the solution, then be sure the reply with the EXACT input example in a TXT file, and perhaps a couple exact outputs as desirable.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 21 Jan 2009 13:51:26 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2009-01-21T13:51:26Z</dc:date>
    <item>
      <title>awk processing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151705#M683793</link>
      <description>hello all,&lt;BR /&gt;&lt;BR /&gt;I am having difficutly getting the following format:&lt;BR /&gt;&lt;BR /&gt;vhost3,U9117.570.65C5B91-V4-C23,inndpr2ap1d1,inndpr2_ap1d1&lt;BR /&gt;&lt;BR /&gt;vhost3,U9117.570.65C5B91-V4-C23,inndpr2ro1d1,inndpr2_ro1d1&lt;BR /&gt;&lt;BR /&gt;I am trying to format all data from the following report:&lt;BR /&gt;&lt;BR /&gt;--------------- -------------------------------------------- ------------------&lt;BR /&gt;vhost0          U9117.570.65C5B91-V4-C20                     0x00000010&lt;BR /&gt;&lt;BR /&gt;VTD                   wmbpr1ro1d1&lt;BR /&gt;Status                Available&lt;BR /&gt;LUN                   0x8100000000000000&lt;BR /&gt;Backing device        wmbpr1_ro1d1&lt;BR /&gt;Physloc&lt;BR /&gt;&lt;BR /&gt;SVSA            Physloc                                      Client Partition ID&lt;BR /&gt;--------------- -------------------------------------------- ------------------&lt;BR /&gt;vhost1          U9117.570.65C5B91-V4-C21                     0x00000011&lt;BR /&gt;&lt;BR /&gt;VTD                   wmbpr2ro1d1&lt;BR /&gt;Status                Available&lt;BR /&gt;LUN                   0x8100000000000000&lt;BR /&gt;Backing device        wmbpr2_ro1d1&lt;BR /&gt;Physloc&lt;BR /&gt;&lt;BR /&gt;SVSA            Physloc                                      Client Partition ID&lt;BR /&gt;--------------- -------------------------------------------- ------------------&lt;BR /&gt;vhost2          U9117.570.65C5B91-V4-C22                     0x00000012&lt;BR /&gt;&lt;BR /&gt;VTD                   inndpr1ap1d1&lt;BR /&gt;Status                Available&lt;BR /&gt;LUN                   0x8200000000000000&lt;BR /&gt;Backing device        inndpr1_ap1d1&lt;BR /&gt;Physloc&lt;BR /&gt;&lt;BR /&gt;VTD                   inndpr1ro1d1&lt;BR /&gt;Status                Available&lt;BR /&gt;LUN                   0x8100000000000000&lt;BR /&gt;Backing device        inndpr1_ro1d1&lt;BR /&gt;Physloc&lt;BR /&gt;&lt;BR /&gt;SVSA            Physloc                                      Client Partition ID&lt;BR /&gt;--------------- -------------------------------------------- ------------------&lt;BR /&gt;vhost3          U9117.570.65C5B91-V4-C23                     0x00000013&lt;BR /&gt;&lt;BR /&gt;VTD                   inndpr2ap1d1&lt;BR /&gt;Status                Available&lt;BR /&gt;LUN                   0x8200000000000000&lt;BR /&gt;Backing device        inndpr2_ap1d1&lt;BR /&gt;Physloc&lt;BR /&gt;&lt;BR /&gt;VTD                   inndpr2ro1d1&lt;BR /&gt;Status                Available&lt;BR /&gt;LUN                   0x8100000000000000&lt;BR /&gt;Backing device        inndpr2_ro1d1&lt;BR /&gt;Physloc&lt;BR /&gt;&lt;BR /&gt;can someone please help?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Wed, 21 Jan 2009 12:07:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151705#M683793</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-01-21T12:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: awk processing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151706#M683794</link>
      <description>Hello Chris,&lt;BR /&gt;&lt;BR /&gt;The general solution for such problems is to become a 'gatherer'. &lt;BR /&gt;Look for stuff (string patterns!) you can recognize and think are stable, and grab bits and pieces only you see somethign which suggests all pieces should have been accumulated.&lt;BR /&gt;After printing often you then need to reset the pieces for the next round, but here you want to keep a header piece which does nto come back each time.&lt;BR /&gt;&lt;BR /&gt;The is a sample awk solution. Just a little more than a 1-liner:&lt;BR /&gt;&lt;BR /&gt;------------------------- test.awk --------&lt;BR /&gt;BEGIN { OFS = "," }&lt;BR /&gt;/^---/ { getline; host=$1; name=$2 }&lt;BR /&gt;/^VTD/ { vtd = $2 }&lt;BR /&gt;/^Back/{ print host,name,vtd,$3}&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;&lt;BR /&gt;use as: # awk -f test.awk test.txt&lt;BR /&gt;&lt;BR /&gt;Notice:&lt;BR /&gt;1) The BEGIN clause sets the Output Field Seperator (OFS) as comma for convenience&lt;BR /&gt;&lt;BR /&gt;2) That "vhostX" is probably not stable enough to latch on to. So the script latches on the the recognizable seperators in the begin of the line before, reads a line (getline) and uses the data from teh next line, not the latch line.&lt;BR /&gt;&lt;BR /&gt;Enjoy!&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jan 2009 12:34:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151706#M683794</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-01-21T12:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: awk processing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151707#M683795</link>
      <description>Hi Hein,&lt;BR /&gt;&lt;BR /&gt;ok thanks - I'll have a look at what I can come up with.&lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Wed, 21 Jan 2009 12:48:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151707#M683795</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-01-21T12:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: awk processing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151708#M683796</link>
      <description>Thanks again Hein,&lt;BR /&gt;&lt;BR /&gt;I have adapted the code for other information I also require.&lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Wed, 21 Jan 2009 13:47:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151708#M683796</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-01-21T13:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: awk processing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151709#M683797</link>
      <description>I meant to carry the hunter/gatherer metaphor further. Hunt for match candidates, gather droppings,... :-)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; I'll have a look at what I can come up with&lt;BR /&gt;&lt;BR /&gt;It should already work. &lt;BR /&gt;If it does not, then that's probably because the forum ate spaces.&lt;BR /&gt;I like using 'anchors' in my search strings, whether they are strictly needed or not, to prevent stray matches and to speed up misses. Here I used "^" to anchor to the begin of line... but that only works as written when there are no leading spaces.&lt;BR /&gt;&lt;BR /&gt;If you have trouble with the solution, then be sure the reply with the EXACT input example in a TXT file, and perhaps a couple exact outputs as desirable.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jan 2009 13:51:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-processing/m-p/5151709#M683797</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-01-21T13:51:26Z</dc:date>
    </item>
  </channel>
</rss>

