<?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 awk - too many fields in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866571#M821463</link>
    <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I have a file with lines formated like so:&lt;BR /&gt;&lt;BR /&gt;OPTION:uname1:uname2:uname3:etc........&lt;BR /&gt;&lt;BR /&gt;What I want to do is add a new username to the end of a specific line within a script. My idea was something along the lines of (don't worry syntax isn't 100% as this is off the top of my head)&lt;BR /&gt;&lt;BR /&gt;awk -F: '{if ( $1 == OPTION) { sub($0,$0:uname4) }; print $0 }'&lt;BR /&gt;&lt;BR /&gt;In other words if the 1st field is the one I'm looking for add the username to the end of the line. The problem I have is I get the following error:&lt;BR /&gt;&lt;BR /&gt;awk: Line uname1:uname2:uname3 cannot have more than 199 fields.&lt;BR /&gt;&lt;BR /&gt;Is there a way round this??&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Ton</description>
    <pubDate>Wed, 18 Dec 2002 11:08:06 GMT</pubDate>
    <dc:creator>Tony Walker</dc:creator>
    <dc:date>2002-12-18T11:08:06Z</dc:date>
    <item>
      <title>awk - too many fields</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866571#M821463</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I have a file with lines formated like so:&lt;BR /&gt;&lt;BR /&gt;OPTION:uname1:uname2:uname3:etc........&lt;BR /&gt;&lt;BR /&gt;What I want to do is add a new username to the end of a specific line within a script. My idea was something along the lines of (don't worry syntax isn't 100% as this is off the top of my head)&lt;BR /&gt;&lt;BR /&gt;awk -F: '{if ( $1 == OPTION) { sub($0,$0:uname4) }; print $0 }'&lt;BR /&gt;&lt;BR /&gt;In other words if the 1st field is the one I'm looking for add the username to the end of the line. The problem I have is I get the following error:&lt;BR /&gt;&lt;BR /&gt;awk: Line uname1:uname2:uname3 cannot have more than 199 fields.&lt;BR /&gt;&lt;BR /&gt;Is there a way round this??&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Ton</description>
      <pubDate>Wed, 18 Dec 2002 11:08:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866571#M821463</guid>
      <dc:creator>Tony Walker</dc:creator>
      <dc:date>2002-12-18T11:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: awk - too many fields</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866572#M821464</link>
      <description># perl -aF: -pe '$F[0] eq "OPTION" and s/$/:uname4/'&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;# perl -pe '/^OPTION:/&amp;amp;&amp;amp;s/$/:uname4/'&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;# perl -pe 's/^(OPTION:.*)/$1:uname4/'&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;DMTOWTDI</description>
      <pubDate>Wed, 18 Dec 2002 11:15:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866572#M821464</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-12-18T11:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: awk - too many fields</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866573#M821465</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;awk can only support up to 199 fields.&lt;BR /&gt;&lt;BR /&gt;Sorry, no other idear ;-(&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Armin</description>
      <pubDate>Wed, 18 Dec 2002 11:21:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866573#M821465</guid>
      <dc:creator>Armin Feller</dc:creator>
      <dc:date>2002-12-18T11:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: awk - too many fields</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866574#M821466</link>
      <description>Procura, thanks for that. I really need to start learning some Perl!!!!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Tony</description>
      <pubDate>Wed, 18 Dec 2002 11:30:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866574#M821466</guid>
      <dc:creator>Tony Walker</dc:creator>
      <dc:date>2002-12-18T11:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: awk - too many fields</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866575#M821467</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;you need perl (of course), but not for this task:&lt;BR /&gt;&lt;BR /&gt;awk '/^OPTION/ {printf("%s:uname4\n",$0)}' &lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Wed, 18 Dec 2002 12:39:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866575#M821467</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2002-12-18T12:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: awk - too many fields</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866576#M821468</link>
      <description>Another good reply. I'm going to use this as I prefer to put commands in my script that I fully understand and my perl needs some work. Thanks again for everyones help.&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Dec 2002 12:53:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-too-many-fields/m-p/2866576#M821468</guid>
      <dc:creator>Tony Walker</dc:creator>
      <dc:date>2002-12-18T12:53:46Z</dc:date>
    </item>
  </channel>
</rss>

