<?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 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722983#M948445</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;awk -F, '{for (i=1;i&amp;lt;=NF;i++){print $i}}' infile &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
    <pubDate>Tue, 14 May 2002 07:43:45 GMT</pubDate>
    <dc:creator>Robin Wakefield</dc:creator>
    <dc:date>2002-05-14T07:43:45Z</dc:date>
    <item>
      <title>AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722975#M948437</link>
      <description>HI,&lt;BR /&gt;&lt;BR /&gt;I trying to extract the fields in a txt file separated by commas as below:&lt;BR /&gt;&lt;BR /&gt;abc,hhh,lll,kkk,ppp,&lt;BR /&gt;dajd,dkjdk,nnn&lt;BR /&gt;mmm&lt;BR /&gt;&lt;BR /&gt;I tried using the script below to extract the these fields, place them into an array and write the array contents into a file.&lt;BR /&gt;&lt;BR /&gt;cat test.sh:&lt;BR /&gt;&lt;BR /&gt; BEGIN {&lt;BR /&gt; split($0, fieldArray, ",")&lt;BR /&gt; for(i in field){&lt;BR /&gt;     print field[i]&lt;BR /&gt;     field[i] &amp;gt;&amp;gt; groupfile  &lt;BR /&gt; }    &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;However, it does not produce any results into the groupfile, but produces a parse error at:&lt;BR /&gt;       field[i] &amp;gt;&amp;gt; groupfile&lt;BR /&gt;&lt;BR /&gt;I tried running the script as follows on the command line:&lt;BR /&gt; $awk -f test.sh inputfile &lt;BR /&gt;&lt;BR /&gt;How should I solve this problem ?&lt;BR /&gt; &lt;BR /&gt;Also, what if I were to have 2 different separators in the input file:&lt;BR /&gt;wmt:*abc-nn-mm:306:abc,kkk,ppp,...&lt;BR /&gt;....,abn&lt;BR /&gt;&lt;BR /&gt;I would only need to extract the fields separated by the commas, not the colons.&lt;BR /&gt;&lt;BR /&gt;How should also do this?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 14 May 2002 04:16:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722975#M948437</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-05-14T04:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722976#M948438</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this:&lt;BR /&gt;&lt;BR /&gt;awk '{ &lt;BR /&gt;         split($0, field, ","); &lt;BR /&gt;         for (i in field) {&lt;BR /&gt;            print field[i] &amp;gt;&amp;gt; groupfile &lt;BR /&gt;         }&lt;BR /&gt;       }' input_file&lt;BR /&gt;&lt;BR /&gt;In split you can use a regular expression as seperator. if you want to use * and , as separator, just try:&lt;BR /&gt;  split ($0, field, "[*,]")&lt;BR /&gt;&lt;BR /&gt;Heiner&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 May 2002 04:43:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722976#M948438</guid>
      <dc:creator>Heiner E. Lennackers</dc:creator>
      <dc:date>2002-05-14T04:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722977#M948439</link>
      <description>You'll find it easier to use the -F option to specify ' as your delimiter. See man awk for details.</description>
      <pubDate>Tue, 14 May 2002 04:44:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722977#M948439</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-05-14T04:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722978#M948440</link>
      <description>HI Heiner,&lt;BR /&gt;&lt;BR /&gt;It produced an ^Invalid char '`' in expression.&lt;BR /&gt;&lt;BR /&gt;Is the sign after awk, a ` or ' and the sign after closing statement a ' or `, as either one produces the same error...?&lt;BR /&gt;&lt;BR /&gt;Please advice.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 14 May 2002 05:13:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722978#M948440</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-05-14T05:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722979#M948441</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;try this&lt;BR /&gt;&lt;BR /&gt;cat filename | akw -F"," '{ print $1 $2 $3 }'&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;JOhn.</description>
      <pubDate>Tue, 14 May 2002 05:41:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722979#M948441</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-05-14T05:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722980#M948442</link>
      <description>HI John,&lt;BR /&gt;&lt;BR /&gt;If the text file has only very little entries, then it works. Unfortunately, the file is rather huge with lots of such entries separated by commas. &lt;BR /&gt;&lt;BR /&gt;Please advice.&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 May 2002 05:51:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722980#M948442</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-05-14T05:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722981#M948443</link>
      <description>Chern,&lt;BR /&gt;These are single-quotes (the ones above the ? key).&lt;BR /&gt;&lt;BR /&gt;The following works fine for me:&lt;BR /&gt;awk '{                &lt;BR /&gt;split($0, field, ",");&lt;BR /&gt;for (i in field) {    &lt;BR /&gt;print field[i]        &lt;BR /&gt;}                     &lt;BR /&gt;}' input_file &amp;gt;&amp;gt; ./groupfile                 &lt;BR /&gt;</description>
      <pubDate>Tue, 14 May 2002 06:00:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722981#M948443</guid>
      <dc:creator>Deepak Extross</dc:creator>
      <dc:date>2002-05-14T06:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722982#M948444</link>
      <description>Chern&lt;BR /&gt;&lt;BR /&gt;can you attach a section of the file so we know what we are dealing with&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;John.</description>
      <pubDate>Tue, 14 May 2002 07:36:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722982#M948444</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-05-14T07:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722983#M948445</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;awk -F, '{for (i=1;i&amp;lt;=NF;i++){print $i}}' infile &amp;gt; outfile&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Tue, 14 May 2002 07:43:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722983#M948445</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2002-05-14T07:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722984#M948446</link>
      <description>l1:/tmp 102 &amp;gt; cat &amp;gt;xx&lt;BR /&gt;aa,bb,dvfgrh:nfbe,fgr;hfhr-z&lt;BR /&gt;243,9474632  jfkweh,fdfwe&lt;BR /&gt;l1:/tmp 103 &amp;gt; perl -naF, -e '$"="\n";print"@F"' xx&lt;BR /&gt;aa&lt;BR /&gt;bb&lt;BR /&gt;dvfgrh:nfbe&lt;BR /&gt;fgr;hfhr-z&lt;BR /&gt;243&lt;BR /&gt;9474632  jfkweh&lt;BR /&gt;fdfwe&lt;BR /&gt;l1:/tmp 104 &amp;gt;</description>
      <pubDate>Tue, 14 May 2002 08:34:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk/m-p/2722984#M948446</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-05-14T08:34:34Z</dc:date>
    </item>
  </channel>
</rss>

