<?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: Increment a # field in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540139#M916568</link>
    <description>cat - &amp;lt;&amp;lt; EOF | ed -s file-1 &lt;BR /&gt;1 s/abc/#abc/ &lt;BR /&gt;w file-1 &lt;BR /&gt;q &lt;BR /&gt;EOF &lt;BR /&gt;</description>
    <pubDate>Wed, 13 Jun 2001 14:06:16 GMT</pubDate>
    <dc:creator>Vincenzo Restuccia</dc:creator>
    <dc:date>2001-06-13T14:06:16Z</dc:date>
    <item>
      <title>Increment a # field</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540138#M916567</link>
      <description>Hello, I am trying to write a script that will open file.txt, increase a # on the first line of the file by 1, then close the file (saving it).  Any ideas?&lt;BR /&gt;Thank you very much.</description>
      <pubDate>Wed, 13 Jun 2001 13:58:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540138#M916567</guid>
      <dc:creator>Jeff Daigle</dc:creator>
      <dc:date>2001-06-13T13:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a # field</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540139#M916568</link>
      <description>cat - &amp;lt;&amp;lt; EOF | ed -s file-1 &lt;BR /&gt;1 s/abc/#abc/ &lt;BR /&gt;w file-1 &lt;BR /&gt;q &lt;BR /&gt;EOF &lt;BR /&gt;</description>
      <pubDate>Wed, 13 Jun 2001 14:06:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540139#M916568</guid>
      <dc:creator>Vincenzo Restuccia</dc:creator>
      <dc:date>2001-06-13T14:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a # field</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540140#M916569</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This would be my way:&lt;BR /&gt;&lt;BR /&gt;F1="myfile.txt"&lt;BR /&gt;N=`line &amp;lt; ${F1}`&lt;BR /&gt;N2=`expr ${N} + 1`&lt;BR /&gt;echo "${N2}" &amp;gt; $F1&lt;BR /&gt;STAT=$?&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Wed, 13 Jun 2001 14:16:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540140#M916569</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-13T14:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a # field</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540141#M916570</link>
      <description>Hi Jeff:&lt;BR /&gt;&lt;BR /&gt;Assume that in your file the second field, on the first line contains the number to be incremented.  Then:&lt;BR /&gt;&lt;BR /&gt;# awk '{if (NR==1){$2=$2+1};print $0}' filein &amp;gt; fileout&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 13 Jun 2001 14:18:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540141#M916570</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-13T14:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a # field</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540142#M916571</link>
      <description>Thank you for the comments.  Greatly appreciated.  In your example, Mr. Ferguson, where does the name of my file (abc.txt) go?&lt;BR /&gt;Thanks again!!</description>
      <pubDate>Wed, 13 Jun 2001 14:24:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540142#M916571</guid>
      <dc:creator>Jeff Daigle</dc:creator>
      <dc:date>2001-06-13T14:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a # field</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540143#M916572</link>
      <description>Hi Jeff:&lt;BR /&gt;&lt;BR /&gt;In the awk script I gave you, 'filein' would be replaced by your file (abc.txt).  That's the input to 'awk'.  The filtered file I simply called 'fileout'.  In reality, you would run the 'awk' script and then overlaid 'filein' with 'fileout', like:&lt;BR /&gt;&lt;BR /&gt;# awk... abc.txt &amp;gt; abc.new&lt;BR /&gt;# mv abc.new abc.txt&lt;BR /&gt;&lt;BR /&gt;With my regards, Jim&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 13 Jun 2001 21:48:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540143#M916572</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-13T21:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Increment a # field</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540144#M916573</link>
      <description>sed -e 's/^/#/g' file.txt &amp;gt; file1.txt; mv file1.txt file.txt&lt;BR /&gt;&lt;BR /&gt;Cheers...&lt;BR /&gt;Satish.</description>
      <pubDate>Thu, 14 Jun 2001 03:46:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/increment-a-field/m-p/2540144#M916573</guid>
      <dc:creator>Satish Y</dc:creator>
      <dc:date>2001-06-14T03:46:17Z</dc:date>
    </item>
  </channel>
</rss>

