<?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: Turn a report into one line per record with awk ? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919612#M104237</link>
    <description>Save the desired info in a variable and print it out at the end. For example,&lt;BR /&gt;&lt;BR /&gt;awk '{/Device Phy/ {ctd=$5;next}&lt;BR /&gt;      /Product ID/ {prodid=$4;next}&lt;BR /&gt;      /Capacity/ {kb=$5;next}&lt;BR /&gt;      /VxVM/ {print ctd, prodid, kb/1000}'&lt;BR /&gt;&lt;BR /&gt;I'm guessing the fields.&lt;BR /&gt;&lt;BR /&gt;Marlou</description>
    <pubDate>Fri, 19 Aug 2005 18:15:47 GMT</pubDate>
    <dc:creator>Marlou Everson</dc:creator>
    <dc:date>2005-08-19T18:15:47Z</dc:date>
    <item>
      <title>Turn a report into one line per record with awk ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919610#M104235</link>
      <description>I would like some awk help.&lt;BR /&gt;&lt;BR /&gt;This is the output from syminq -clar -v.  It produces some 15 lines for every LUN presented to this server:&lt;BR /&gt;&lt;BR /&gt; Device Physical Name     : /dev/rdsk/c101t5d3 &lt;BR /&gt;    Device Serial ID         : Ch2 CONT &lt;BR /&gt;&lt;BR /&gt;    Vendor ID                : DGC &lt;BR /&gt;    Product ID               : CX700WDR5 &lt;BR /&gt;    Product Revision         : HP03 &lt;BR /&gt;&lt;BR /&gt;    Peripheral Device Type   : Direct Access &lt;BR /&gt;&lt;BR /&gt;    Controller Number        :  65 &lt;BR /&gt;    Target ID                :   5 &lt;BR /&gt;    Logical Unit Number      :   3 &lt;BR /&gt;&lt;BR /&gt;    Capacity (in KB)         :    8838720 &lt;BR /&gt;&lt;BR /&gt;    Clariion ID              : APM00052802175 &lt;BR /&gt;    Device Clariion Name     : 0117 &lt;BR /&gt;&lt;BR /&gt;    Device State             : ASSIGNED &lt;BR /&gt;    Device WWN               : 60:06:01:60:90:84:15:00:5C:B1:65:C1:AC:10:DA:11 &lt;BR /&gt;&lt;BR /&gt;    Powerpath Device Type    : CHILD &lt;BR /&gt;&lt;BR /&gt;    VxVM DMP Device Type     : N/A &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    Device Physical Name     : /dev/rdsk/c101t5d4 &lt;BR /&gt;    Device Serial ID         : Ch2 CONT &lt;BR /&gt;&lt;BR /&gt;    Vendor ID                : DGC &lt;BR /&gt;    Product ID               : CX700WDR5 &lt;BR /&gt;    Product Revision         : HP03 &lt;BR /&gt;&lt;BR /&gt;    Peripheral Device Type   : Direct Access &lt;BR /&gt;&lt;BR /&gt;    Controller Number        :  65 &lt;BR /&gt;    Target ID                :   5 &lt;BR /&gt;    Logical Unit Number      :   4 &lt;BR /&gt;&lt;BR /&gt;    Capacity (in KB)         :   70709760 &lt;BR /&gt;&lt;BR /&gt;    Clariion ID              : APM00052802175 &lt;BR /&gt;    Device Clariion Name     : 0116 &lt;BR /&gt;&lt;BR /&gt;    Device State             : ASSIGNED &lt;BR /&gt;    Device WWN               : 60:06:01:60:90:84:15:00:FC:B4:A8:13:AC:10:DA:11 &lt;BR /&gt;&lt;BR /&gt;    Powerpath Device Type    : CHILD &lt;BR /&gt;&lt;BR /&gt;    VxVM DMP Device Type     : N/A &lt;BR /&gt;&lt;BR /&gt;I would like to turn this into one line per LUN, like this:&lt;BR /&gt;&lt;BR /&gt;Dev       Type      GB        Array     LuN&lt;BR /&gt;c101t5d3  CX700WDR5 7079760  APM..2175  0116&lt;BR /&gt;&lt;BR /&gt;But I cant' figure out how to do it. &lt;BR /&gt;&lt;BR /&gt;I tried:&lt;BR /&gt;&lt;BR /&gt;awk '{RS="Device Physical Name"; print $3, $9...}'&lt;BR /&gt;&lt;BR /&gt;but it's not working..</description>
      <pubDate>Fri, 19 Aug 2005 14:44:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919610#M104235</guid>
      <dc:creator>Stuart Abramson</dc:creator>
      <dc:date>2005-08-19T14:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Turn a report into one line per record with awk ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919611#M104236</link>
      <description>syminq -v -clar | egrep "Device Physical Name|Product ID|Capacity \(in KB\)|Clariion ID|Device Clariion Name" | tr "\n" "\c"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Aug 2005 14:57:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919611#M104236</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2005-08-19T14:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Turn a report into one line per record with awk ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919612#M104237</link>
      <description>Save the desired info in a variable and print it out at the end. For example,&lt;BR /&gt;&lt;BR /&gt;awk '{/Device Phy/ {ctd=$5;next}&lt;BR /&gt;      /Product ID/ {prodid=$4;next}&lt;BR /&gt;      /Capacity/ {kb=$5;next}&lt;BR /&gt;      /VxVM/ {print ctd, prodid, kb/1000}'&lt;BR /&gt;&lt;BR /&gt;I'm guessing the fields.&lt;BR /&gt;&lt;BR /&gt;Marlou</description>
      <pubDate>Fri, 19 Aug 2005 18:15:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919612#M104237</guid>
      <dc:creator>Marlou Everson</dc:creator>
      <dc:date>2005-08-19T18:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Turn a report into one line per record with awk ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919613#M104238</link>
      <description>&lt;BR /&gt;Marlou outlines the classic and recommended solution, specially if you are goinf to be selecting specific fields, adn possibly re-ordering the output.&lt;BR /&gt;&lt;BR /&gt;Now if the problem is simple "I would like to turn this into one line per LUN" then the answer would be:&lt;BR /&gt;&lt;BR /&gt;awk -F" : " '{if (NF&amp;gt;1){ line = line " " $2}}/^VxVM/{print line; line = ""}' x&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;. make " : " the field seperator.&lt;BR /&gt;. if more than 1 field in the input then add field 2 to variable 'line'.&lt;BR /&gt;. if input starts with VxVM then print the line variable and clear it.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Aug 2005 23:13:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919613#M104238</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-08-19T23:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Turn a report into one line per record with awk ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919614#M104239</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If the string with VxVM DMP Device Type is the last in the output, try this:&lt;BR /&gt; awk 'NF&amp;lt;2{next}&lt;BR /&gt;/VxVM DMP Device Type/ {print $NF;next}&lt;BR /&gt;{printf("%s ",$NF}'&lt;BR /&gt;&lt;BR /&gt;HTH</description>
      <pubDate>Sat, 20 Aug 2005 09:43:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919614#M104239</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2005-08-20T09:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Turn a report into one line per record with awk ?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919615#M104240</link>
      <description>all good answers.  Thanks.</description>
      <pubDate>Mon, 22 Aug 2005 10:35:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/turn-a-report-into-one-line-per-record-with-awk/m-p/4919615#M104240</guid>
      <dc:creator>Stuart Abramson</dc:creator>
      <dc:date>2005-08-22T10:35:29Z</dc:date>
    </item>
  </channel>
</rss>

