<?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: getting fields to print in awk in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060775#M94175</link>
    <description># awk '/ASM_/ {for(i=1;i&amp;lt;=NF;i++) printf(i&lt;NF&gt;&lt;/NF&gt;</description>
    <pubDate>Tue, 31 Jul 2007 11:24:55 GMT</pubDate>
    <dc:creator>Sandman!</dc:creator>
    <dc:date>2007-07-31T11:24:55Z</dc:date>
    <item>
      <title>getting fields to print in awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060774#M94174</link>
      <description>Guys can you help me with the following:&lt;BR /&gt;&lt;BR /&gt;--&amp;gt; ./asm.ksh as_oracle&lt;BR /&gt;&lt;BR /&gt;Report Run Date&lt;BR /&gt;--------------------------&lt;BR /&gt;31-JUL-2007 16:23:08&lt;BR /&gt;&lt;BR /&gt;Server&lt;BR /&gt;---------------&lt;BR /&gt;heidegger&lt;BR /&gt;&lt;BR /&gt;Disk Group           Total Mb   Free Mb&lt;BR /&gt;-------------------- -------- ---------&lt;BR /&gt;ASM_DATA                73728     20495&lt;BR /&gt;ASM_FLASH              110592     96233&lt;BR /&gt;&lt;BR /&gt;the information i require is:&lt;BR /&gt;&lt;BR /&gt;ASM_DATA,73728,20495&lt;BR /&gt;ASM_FLASH,110592,96233&lt;BR /&gt;&lt;BR /&gt;so I have attempted the syntax:&lt;BR /&gt;&lt;BR /&gt;awk 'NR&amp;gt;11 {if ($1~/ASM_DATA/) {OFS=",";print $1,$2,$3}}; {if ($1~/ASM_FLASH/) {OFS=",";print $1,$2,$3}}'&lt;BR /&gt;&lt;BR /&gt;This does work however I want to know if this is the best code to run, as I am learning awk I want to ensure my knowledge is complete.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Chris.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:19:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060774#M94174</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2007-07-31T11:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: getting fields to print in awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060775#M94175</link>
      <description># awk '/ASM_/ {for(i=1;i&amp;lt;=NF;i++) printf(i&lt;NF&gt;&lt;/NF&gt;</description>
      <pubDate>Tue, 31 Jul 2007 11:24:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060775#M94175</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-07-31T11:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: getting fields to print in awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060776#M94176</link>
      <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;Use a 'BEGIN' block to set your OFS; avoid the line-number check and simply match an either/or pattern:&lt;BR /&gt;&lt;BR /&gt;# awk 'BEGIN{OFS=","};{if ($1~/ASM_DATA/||$1~/ASM_FLASH/) {print $1,$2,$3}}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 31 Jul 2007 11:30:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060776#M94176</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-07-31T11:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: getting fields to print in awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060777#M94177</link>
      <description>thanks chaps,&lt;BR /&gt;&lt;BR /&gt;will will have a play with yours sandman :)&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 31 Jul 2007 11:42:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060777#M94177</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2007-07-31T11:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: getting fields to print in awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060778#M94178</link>
      <description>Thanks again,&lt;BR /&gt;&lt;BR /&gt;and I'll rephrase my last comment&lt;BR /&gt;&lt;BR /&gt;I'll have a play with your code sandman!!&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Tue, 31 Jul 2007 11:44:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060778#M94178</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2007-07-31T11:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: getting fields to print in awk</title>
      <link>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060779#M94179</link>
      <description>Chris,&lt;BR /&gt;&lt;BR /&gt;Thanks for trying the code I posted though the play on words escapes me ;)</description>
      <pubDate>Tue, 31 Jul 2007 12:45:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/getting-fields-to-print-in-awk/m-p/5060779#M94179</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-07-31T12:45:52Z</dc:date>
    </item>
  </channel>
</rss>

