<?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: parse and increment by 1 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540306#M916511</link>
    <description>I am looking for the file to be like this each time:&lt;BR /&gt;&lt;BR /&gt;1st time :20:00001&lt;BR /&gt;2nd time :20:00002&lt;BR /&gt;3rd time :20:00003&lt;BR /&gt;&lt;BR /&gt;and so on...&lt;BR /&gt;&lt;BR /&gt;Thank you very much!</description>
    <pubDate>Wed, 13 Jun 2001 20:15:02 GMT</pubDate>
    <dc:creator>Jeff Daigle</dc:creator>
    <dc:date>2001-06-13T20:15:02Z</dc:date>
    <item>
      <title>parse and increment by 1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540303#M916508</link>
      <description>Hello, I have a file named test.dat which has this in it:&lt;BR /&gt;&lt;BR /&gt;:20:00001&lt;BR /&gt;&lt;BR /&gt;I'm trying to write a script that leaves the :20: at the beginning, but increases the 00001 by 1 each time I run it. I have this so far:&lt;BR /&gt;&lt;BR /&gt;export F1=/jeff/test.dat&lt;BR /&gt;N='line &amp;lt; ${F1}'&lt;BR /&gt;N2='echo $N | awk -F: 'printf $3}' | sed 's/1/9/g''&lt;BR /&gt;N3=`expr ${N2} + 1`&lt;BR /&gt;echo "${N3}" &amp;gt; $F1&lt;BR /&gt;STAT=$?&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;It's not quite working.  Any help/ suggestions would be appreciated!</description>
      <pubDate>Wed, 13 Jun 2001 19:07:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540303#M916508</guid>
      <dc:creator>Jeff Daigle</dc:creator>
      <dc:date>2001-06-13T19:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: parse and increment by 1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540304#M916509</link>
      <description>Hi Jeff,&lt;BR /&gt;&lt;BR /&gt;This is easy but I have one quick question.&lt;BR /&gt;&lt;BR /&gt;Is the :20: constant or are you trying to have a file like this:&lt;BR /&gt;:20:000001&lt;BR /&gt;:30:000012&lt;BR /&gt;:40:000003&lt;BR /&gt;&lt;BR /&gt;Does the file have separate counters or is this just the single entry? If you tell us that the rest is easy.&lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Wed, 13 Jun 2001 19:29:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540304#M916509</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-13T19:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: parse and increment by 1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540305#M916510</link>
      <description>Jeff,&lt;BR /&gt;&lt;BR /&gt;Here is a cheap way to do it:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;F1=/jeff/test.dat&lt;BR /&gt;typeset -Z5 NUM=$(awk -F: '{print $3}' $F1)&lt;BR /&gt;let NUM=NUM+1&lt;BR /&gt;echo ":20:${NUM}" &amp;gt;$F1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Jun 2001 19:38:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540305#M916510</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2001-06-13T19:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: parse and increment by 1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540306#M916511</link>
      <description>I am looking for the file to be like this each time:&lt;BR /&gt;&lt;BR /&gt;1st time :20:00001&lt;BR /&gt;2nd time :20:00002&lt;BR /&gt;3rd time :20:00003&lt;BR /&gt;&lt;BR /&gt;and so on...&lt;BR /&gt;&lt;BR /&gt;Thank you very much!</description>
      <pubDate>Wed, 13 Jun 2001 20:15:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540306#M916511</guid>
      <dc:creator>Jeff Daigle</dc:creator>
      <dc:date>2001-06-13T20:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: parse and increment by 1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540307#M916512</link>
      <description>Hi Clay, also, the file doesn't have separate counters.  It is just a file that needs to begin with the :20: and then needs a number after the :20: to increase by one each time.&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;Jeff &lt;BR /&gt;</description>
      <pubDate>Wed, 13 Jun 2001 20:17:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540307#M916512</guid>
      <dc:creator>Jeff Daigle</dc:creator>
      <dc:date>2001-06-13T20:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: parse and increment by 1</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540308#M916513</link>
      <description>Hi Jeff,&lt;BR /&gt;&lt;BR /&gt;I attached a 2 minute script to do this. You may need to change the value of F1 to whatever your filename is.&lt;BR /&gt;&lt;BR /&gt;Enjoy, Clay</description>
      <pubDate>Wed, 13 Jun 2001 20:58:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parse-and-increment-by-1/m-p/2540308#M916513</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-06-13T20:58:14Z</dc:date>
    </item>
  </channel>
</rss>

