<?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 - using one field separator, then another? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073951#M141297</link>
    <description>&lt;BR /&gt;The -F argument and corresponding FS variable is a full regular expression. So in this case you can just use both "," and ":" as seperators giving:&lt;BR /&gt;&lt;BR /&gt;uptime|awk -F[:,] '{print $7}'&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Thu, 18 Sep 2003 12:59:39 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2003-09-18T12:59:39Z</dc:date>
    <item>
      <title>Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073940#M141286</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;Here's one thats been bugging me for a while. Basically, I want to pull out the current load average from uptime ie :&lt;BR /&gt; 10:46am  up 55 days, 14:06,  159 users,  load average: 3.34, 3.28, 3.39&lt;BR /&gt;&lt;BR /&gt;Theory goes, use and FS of ":" and get the 4th field, then use an FS of "," and get the first thus ending up with 3.34. I'm sure there are better ways but I've come across a similar problem before and want to know whether this is possible in awk?&lt;BR /&gt;&lt;BR /&gt;As always, help greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Tony&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Sep 2003 08:47:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073940#M141286</guid>
      <dc:creator>Tony Walker</dc:creator>
      <dc:date>2003-09-18T08:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073941#M141287</link>
      <description>This depends a little bit on how you want the information returned toyou but how about &lt;BR /&gt;&lt;BR /&gt;expr "`uptime`" : ".*load average: \(.*\)" and pipe the&lt;BR /&gt;output into "cut" or "awk" or whatever.</description>
      <pubDate>Thu, 18 Sep 2003 09:07:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073941#M141287</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-09-18T09:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073942#M141288</link>
      <description>Tony&lt;BR /&gt;&lt;BR /&gt;1) you can replace "," with spaces either with sed or tr before you pipe results into awk&lt;BR /&gt;&lt;BR /&gt;2) you can use the split function in awk&lt;BR /&gt;split(s,a,fs) fs = field separator&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Thu, 18 Sep 2003 09:28:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073942#M141288</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-09-18T09:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073943#M141289</link>
      <description>Jean-luc - I should have awarded you 10points! Just tried the split function in awk and it works just how I want.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Tony</description>
      <pubDate>Thu, 18 Sep 2003 09:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073943#M141289</guid>
      <dc:creator>Tony Walker</dc:creator>
      <dc:date>2003-09-18T09:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073944#M141290</link>
      <description>Usually the "bunny" means that solution is provided and complete.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Thu, 18 Sep 2003 09:45:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073944#M141290</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-09-18T09:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073945#M141291</link>
      <description>Zero points&lt;BR /&gt;&lt;BR /&gt;It looks like you Jean-Luc, and you now have the opportunity to award them.  At any rate, another approach could be:&lt;BR /&gt;&lt;BR /&gt;echo $In|cut -d\: -f2|cut -d\, -f[1|2|3]&lt;BR /&gt;&lt;BR /&gt;choose which field [1|2|3] you want....&lt;BR /&gt;Not looking for points - just providing an alternative.&lt;BR /&gt;&lt;BR /&gt;Rob&lt;BR /&gt;&lt;BR /&gt;Zero points</description>
      <pubDate>Thu, 18 Sep 2003 10:31:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073945#M141291</guid>
      <dc:creator>Rob_132</dc:creator>
      <dc:date>2003-09-18T10:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073946#M141292</link>
      <description>Zero points&lt;BR /&gt;&lt;BR /&gt;make that, &lt;BR /&gt;&lt;BR /&gt;"It looks like you OWE Jean-Luc...."&lt;BR /&gt;&lt;BR /&gt;Rob&lt;BR /&gt;&lt;BR /&gt;Zero points</description>
      <pubDate>Thu, 18 Sep 2003 10:34:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073946#M141292</guid>
      <dc:creator>Rob_132</dc:creator>
      <dc:date>2003-09-18T10:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073947#M141293</link>
      <description>Zero points&lt;BR /&gt;&lt;BR /&gt;(sorry!!)...AND *Y O U* will be the one to promote Jean-Luc to *W I Z A R D*&lt;BR /&gt;&lt;BR /&gt;Too compelling to pass up, I'd say!&lt;BR /&gt;&lt;BR /&gt;Rob&lt;BR /&gt;&lt;BR /&gt;Zero points</description>
      <pubDate>Thu, 18 Sep 2003 10:37:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073947#M141293</guid>
      <dc:creator>Rob_132</dc:creator>
      <dc:date>2003-09-18T10:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073948#M141294</link>
      <description>Thanks for the input Rob, I'll give you some points you didn't ask for later:) So, you the points system then...</description>
      <pubDate>Thu, 18 Sep 2003 10:41:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073948#M141294</guid>
      <dc:creator>Tony Walker</dc:creator>
      <dc:date>2003-09-18T10:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073949#M141295</link>
      <description>Come on, make Jean-Luc a Wizard.&lt;BR /&gt;&lt;BR /&gt;I would like to see a complete example.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 18 Sep 2003 11:02:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073949#M141295</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-09-18T11:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073950#M141296</link>
      <description>Steve - just for you..&lt;BR /&gt;&lt;BR /&gt;uptime|awk -F: '{MYVAR=$4;split(MYVAR,mv,",");print mv[1]}'</description>
      <pubDate>Thu, 18 Sep 2003 12:28:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073950#M141296</guid>
      <dc:creator>Tony Walker</dc:creator>
      <dc:date>2003-09-18T12:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Awk - using one field separator, then another?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073951#M141297</link>
      <description>&lt;BR /&gt;The -F argument and corresponding FS variable is a full regular expression. So in this case you can just use both "," and ":" as seperators giving:&lt;BR /&gt;&lt;BR /&gt;uptime|awk -F[:,] '{print $7}'&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Sep 2003 12:59:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-using-one-field-separator-then-another/m-p/3073951#M141297</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2003-09-18T12:59:39Z</dc:date>
    </item>
  </channel>
</rss>

