<?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 question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700534#M932853</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This worked as a quick test&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo 1**2|awk  -F "[*][*]" '{print $2}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;          Steve Steel</description>
    <pubDate>Wed, 10 Apr 2002 06:45:03 GMT</pubDate>
    <dc:creator>Steve Steel</dc:creator>
    <dc:date>2002-04-10T06:45:03Z</dc:date>
    <item>
      <title>awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700531#M932850</link>
      <description>Hi, &lt;BR /&gt;I have a file where fields are seprated by ** .&lt;BR /&gt;I need to use awk with -F option to select the second field.&lt;BR /&gt;If the fields are seprated by *, i am able to select by using -F'*' but for **, i have tried different combinations but nothing is working.I tried -F"**" , -F'**' , -F\*\* but no luck.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;AR</description>
      <pubDate>Wed, 10 Apr 2002 06:24:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700531#M932850</guid>
      <dc:creator>Aashish Raj</dc:creator>
      <dc:date>2002-04-10T06:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700532#M932851</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the field separator is supposed to be one character only.  So if "**" is used in the input file, use "*" as field separator, and skip those empty fields between the double "*".&lt;BR /&gt;&lt;BR /&gt;good luck,&lt;BR /&gt;Thierry.</description>
      <pubDate>Wed, 10 Apr 2002 06:36:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700532#M932851</guid>
      <dc:creator>Thierry Poels_1</dc:creator>
      <dc:date>2002-04-10T06:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700533#M932852</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'd probably set FS in this instance:&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN{FS="\*\*"}{print $3}' filename&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Wed, 10 Apr 2002 06:38:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700533#M932852</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-04-10T06:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700534#M932853</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This worked as a quick test&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;echo 1**2|awk  -F "[*][*]" '{print $2}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;          Steve Steel</description>
      <pubDate>Wed, 10 Apr 2002 06:45:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700534#M932853</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-04-10T06:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700535#M932854</link>
      <description>First run&lt;BR /&gt;sed 's/\*\*/\|/g' &lt;FILENAME&gt;&lt;BR /&gt;to replace the "**" delimiter with "|".&lt;BR /&gt;Then run awk using -F\|&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;/FILENAME&gt;</description>
      <pubDate>Wed, 10 Apr 2002 06:47:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700535#M932854</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-04-10T06:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700536#M932855</link>
      <description>awk -F '\\\*\\\*'  ' { print $1}' file1</description>
      <pubDate>Wed, 10 Apr 2002 07:38:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700536#M932855</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2002-04-10T07:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700537#M932856</link>
      <description>I go with Robin:&lt;BR /&gt;&lt;BR /&gt;$&amp;gt; cat testfile&lt;BR /&gt;11**22**33&lt;BR /&gt;44**55**66&lt;BR /&gt;$&amp;gt; awk '{FS="\*\*"}{print $2}'testfile&lt;BR /&gt;22&lt;BR /&gt;55&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ceesjan&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Apr 2002 08:52:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700537#M932856</guid>
      <dc:creator>Ceesjan van Hattum</dc:creator>
      <dc:date>2002-04-10T08:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700538#M932857</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;awk expects as -F argument a regular expression. Because * is a multiplier in a regex, you have to define it as a character class. &lt;BR /&gt;e.g:&lt;BR /&gt;echo 1**2 | awk -F '[*][*]' '{print $2}'&lt;BR /&gt;&lt;BR /&gt;echo 1**2 | awk -F '[*]{2}' '{print $2}'&lt;BR /&gt;&lt;BR /&gt;Heiner</description>
      <pubDate>Wed, 10 Apr 2002 11:42:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700538#M932857</guid>
      <dc:creator>Heiner E. Lennackers</dc:creator>
      <dc:date>2002-04-10T11:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: awk question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700539#M932858</link>
      <description>Hi Aashish,&lt;BR /&gt;&lt;BR /&gt;You tried F"**" , -F'**' , -F\*\* but you didn't try -F'\\**'&lt;BR /&gt;&lt;BR /&gt;Try two backslashes for two ** like this&lt;BR /&gt;&lt;BR /&gt;ON HP's&lt;BR /&gt;echo "1**2**3**4" | awk -F'\\**' '{print $3,$4}'&lt;BR /&gt;&lt;BR /&gt;use nawk on Sun's with the same syntax&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Wed, 10 Apr 2002 17:21:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question/m-p/2700539#M932858</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-04-10T17:21:09Z</dc:date>
    </item>
  </channel>
</rss>

