<?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: script tips help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958997#M291489</link>
    <description>&lt;!--!*#--&gt;&amp;gt;&amp;gt; This is an urgent production request, not much time for learning curve. My script skills are very limited. I appreciate any help.&lt;BR /&gt;&lt;BR /&gt;And I do hope you get all the help you need,&lt;BR /&gt;but I can not help but feel worried about an organization which relies on best effort from a bunch of geeks and self proclaimed wizards like myslef to help with 'urgent production problems'.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Can someone help me?&lt;BR /&gt;&lt;BR /&gt;Sure, for mere money I'll be glad to solve this problem. Be sure to contact me!.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; if($1 == "C") sub("^C","R")&lt;BR /&gt;&lt;BR /&gt;I think you'll be {} around the conditional part after the if, and a ; after teh next line?&lt;BR /&gt;&lt;BR /&gt;imho this is not beyong a one-line and should be recoded as a little awk script.&lt;BR /&gt;&lt;BR /&gt;See my UNTESTED re-org below...&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;BEGIN {&lt;BR /&gt;    okb="/tmp/outok"; &lt;BR /&gt;    fab="/tmp/fail"; &lt;BR /&gt;    g=0;&lt;BR /&gt;    b=0;&lt;BR /&gt;    lim=100000&lt;BR /&gt;    }&lt;BR /&gt;    &lt;BR /&gt;{   if (buf) { print buf&amp;gt;outf}&lt;BR /&gt;     if($1 == "C") { sub("^C","R") }&lt;BR /&gt;        buf = $0;&lt;BR /&gt;        if (NF==19) { &lt;BR /&gt;          g++; &lt;BR /&gt;          outf=(okb""int(g/lim))&lt;BR /&gt;          } else {&lt;BR /&gt;       b++; &lt;BR /&gt;       outf=(fab""int(b/lim))&lt;BR /&gt;       }&lt;BR /&gt;        }&lt;BR /&gt;END {&lt;BR /&gt;  if (buf) {&lt;BR /&gt;    sub("^R","X",buf);&lt;BR /&gt;    print buf &amp;gt;outf&lt;BR /&gt;    } &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 12 Mar 2007 18:08:02 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-03-12T18:08:02Z</dc:date>
    <item>
      <title>script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958981#M291473</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have in my put file, each line contains "|" delimiter.  I have to process this file counting the number of pipes.  If the count is not 18 I have to put those line into a different files.&lt;BR /&gt;&lt;BR /&gt;Basically spilt the files into two.&lt;BR /&gt;&lt;BR /&gt;on file with lines that has 18 pipes.&lt;BR /&gt;other lines.&lt;BR /&gt;&lt;BR /&gt;Please see the sample input line:&lt;BR /&gt;&lt;BR /&gt;C|2630|000000058|No Item Name Available||9||||||||1|1|1|1|1|N&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Mar 2007 12:38:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958981#M291473</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-09T12:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958982#M291474</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;18 delimiters == 19 fields; awk solution:&lt;BR /&gt;&lt;BR /&gt;awk -F'|' 'NF != 19' infile &amp;gt;outfile&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 09 Mar 2007 12:54:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958982#M291474</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-03-09T12:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958983#M291475</link>
      <description>After thinking about it I thought that keeping this code dumb was the best option.  I suggest the following...&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;LINE="C|2630|000000058|No Item Name Available||9||||||||1|1|1|1|1|N"&lt;BR /&gt;&lt;BR /&gt;numFields=1&lt;BR /&gt;subLINE=${LINE#*\|}&lt;BR /&gt;&lt;BR /&gt;while [[ ${subLINE} != ${LINE} &amp;amp;&amp;amp; -n ${subLINE} ]]&lt;BR /&gt;do&lt;BR /&gt;  (( numFields = $numFields + 1 ))&lt;BR /&gt;  subLINE=${subLINE#*\|}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;print "$numFields"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Add your "read LINE" and similar code as needed.</description>
      <pubDate>Fri, 09 Mar 2007 13:09:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958983#M291475</guid>
      <dc:creator>Bob E Campbell</dc:creator>
      <dc:date>2007-03-09T13:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958984#M291476</link>
      <description>awk -F'|' 'NF != 19' infile &amp;gt;outfile&lt;BR /&gt;&lt;BR /&gt;Peters solution will give the bad lines.&lt;BR /&gt;&lt;BR /&gt;You woudl need a secong run over the file to give the good lines:&lt;BR /&gt;&lt;BR /&gt;awk -F'|' 'NF == 19' infile &amp;gt; good&lt;BR /&gt;&lt;BR /&gt;Or combine them with &lt;BR /&gt;&lt;BR /&gt;awk -F'|' 'NF==19 {print} NF!=19{print &amp;gt; "Bad.txt\"' Good.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Or&lt;BR /&gt;&lt;BR /&gt;awk -F'|' '{ if (NF==19) {print} else {print &amp;gt; "Bad.txt\"}' Good.txt&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Mar 2007 13:17:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958984#M291476</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-09T13:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958985#M291477</link>
      <description>Ooops, remove teh \ from \" in my suggestions. Testing on Windoze again...&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Mar 2007 13:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958985#M291477</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-09T13:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958986#M291478</link>
      <description>All,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for the tips. I will try and let you know and assign points.&lt;BR /&gt;&lt;BR /&gt;kesh</description>
      <pubDate>Fri, 09 Mar 2007 13:22:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958986#M291478</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-09T13:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958987#M291479</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;The solution works with two passes. For some reason I am not able to make it work with one pass. I can live with it for now.&lt;BR /&gt;&lt;BR /&gt;Another question is I have this file 2GB I need to split the file into 20MB files.  Can someone help with any tips on this?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;kesh</description>
      <pubDate>Mon, 12 Mar 2007 11:37:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958987#M291479</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-12T11:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958988#M291480</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Another question is I have this file 2GB I need to split the file into 20MB files. Can someone help with any tips on this?&lt;BR /&gt;&lt;BR /&gt;See the manpages for 'split':&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60127/split.1.html" target="_blank"&gt;http://docs.hp.com/en/B2355-60127/split.1.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B2355-60127/csplit.1.html" target="_blank"&gt;http://docs.hp.com/en/B2355-60127/csplit.1.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 12 Mar 2007 11:54:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958988#M291480</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-03-12T11:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958989#M291481</link>
      <description>I just got more request on this script:&lt;BR /&gt;&lt;BR /&gt;1.  Input file is 2GB I need  to split this into 20MB chuncks&lt;BR /&gt;&lt;BR /&gt;2.  First field in each line must be replaced by "R" from "C" except the last line must be "X"&lt;BR /&gt;&lt;BR /&gt;This is an urgent production request, not much time for learning curve.  My script skills are very limited.  I appreciate any help.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Mar 2007 11:57:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958989#M291481</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-12T11:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958990#M291482</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;a size splitting would potentially break a file in the middle of a line - I'm shure this is not what you want.&lt;BR /&gt;If sou want to have small sized output files only, I suggest to count line numbers and have a break at e.g. 100000 - configure this and the names of your resulting filenames in the BEGIN section. The output files suffx will start with zero.&lt;BR /&gt;&lt;BR /&gt;awk -F'|' 'BEGIN {okb="/tmp/outok"; fab="/tmp/fail"; g=0;b=0;lim=100000}&lt;BR /&gt;{ if (NF==19) { g++; print $0&amp;gt;(okb""int(g/lim))}&lt;BR /&gt;  else {b++; print $0&amp;gt;(fab""int(b/lim))} }' infile&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 12 Mar 2007 12:21:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958990#M291482</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-03-12T12:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958991#M291483</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;forgot to ask for your request 2:&lt;BR /&gt;What is the 'last line' in respect to request 1?&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 12 Mar 2007 12:24:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958991#M291483</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-03-12T12:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958992#M291484</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot for your help.&lt;BR /&gt;&lt;BR /&gt;Another request is &lt;BR /&gt;&lt;BR /&gt;First field in each line must be replaced by "R" from "C".  If it is last line it must be replaced by "X".&lt;BR /&gt;&lt;BR /&gt;I have a question on your awk line:&lt;BR /&gt;&lt;BR /&gt;awk -F'|' 'BEGIN {okb="/tmp/outok"; fab="/tmp/fail"; g=0;b=0;lim=100000}&lt;BR /&gt;{ if (NF==19) { g++; print $0&amp;gt;(okb""int(g/lim))}&lt;BR /&gt;  else {b++; print $0&amp;gt;(fab""int(b/lim))} }' infile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;what will be the output file names?&lt;BR /&gt;&lt;BR /&gt;Also another point I like to bring it your attention is input file is 2GB file.  I hope processing time will not be an issue&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;kesh</description>
      <pubDate>Mon, 12 Mar 2007 12:38:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958992#M291484</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-12T12:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958993#M291485</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt;I see the output file names.  I tested your AWK comnad , it seems split is working.&lt;BR /&gt;&lt;BR /&gt;As far as the first field replacement, I was going to read each line in the loop and replacing the first field with "R" except the last line with "X".&lt;BR /&gt;&lt;BR /&gt;Is there a better way to do it?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Mar 2007 13:07:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958993#M291485</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-12T13:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958994#M291486</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;the names of the output files will be&lt;BR /&gt;/tmp/outok0, /tmp/outok1, ...&lt;BR /&gt;for the OK-lines and&lt;BR /&gt;/tmp/fail0, /tmp/fail1, ...&lt;BR /&gt;for the irregular lines.&lt;BR /&gt;&lt;BR /&gt;Processing time won't be different for one very big or the sum of fewer lesser big files.&lt;BR /&gt;&lt;BR /&gt;The change from 'C' to 'R' in the first field is easy, the 'X'-substitution not.&lt;BR /&gt;Dealing with "the last line" leads to a common problem: during processing we do not know wether more input will arrive or not.&lt;BR /&gt;For such a processing we need a buffering mechanism:&lt;BR /&gt;&lt;BR /&gt;awk -F'|' 'BEGIN {okb="/tmp/outok"; fab="/tmp/fail"; g=0;b=0;lim=100000}&lt;BR /&gt;{ if (buf) print buf&amp;gt;outf&lt;BR /&gt;  if($1 == "C") sub("^C","R")&lt;BR /&gt;  buf=$0&lt;BR /&gt;  if (NF==19) { g++; outf=(okb""int(g/lim))}&lt;BR /&gt;  else {b++; outf=(fab""int(b/lim))}&lt;BR /&gt;}&lt;BR /&gt;END {if (buf) {sub("^R","X",buf);print buf &amp;gt;outf} }' infile&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Mon, 12 Mar 2007 13:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958994#M291486</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-03-12T13:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958995#M291487</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt;I cut/paste your script.  this is the error I got.&lt;BR /&gt;&lt;BR /&gt;awk: syntax error near line 3&lt;BR /&gt;awk: illegal statement near line 3&lt;BR /&gt;awk: syntax error near line 8&lt;BR /&gt;awk: illegal statement near line 8&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;awk -F'|' 'BEGIN {okb="/tmp/outok"; fab="/tmp/fail"; g=0;b=0;lim=100000}&lt;BR /&gt;{ if (buf) print buf&amp;gt;outf&lt;BR /&gt;  if($1 == "C") sub("^C","R")&lt;BR /&gt;  buf=$0&lt;BR /&gt;  if (NF==19) { g++; outf=(okb""int(g/lim))}&lt;BR /&gt;  else {b++; outf=(fab""int(b/lim))}&lt;BR /&gt;}&lt;BR /&gt;END {if (buf) {sub("^R","X",buf);print buf &amp;gt;outf} }' infile&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Mar 2007 14:33:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958995#M291487</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-12T14:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958996#M291488</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I am trying to implement this AWK script which Peter has sent.  I am getting syntax error on the "sub" line.&lt;BR /&gt;&lt;BR /&gt;Can someone help me?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;awk: syntax error near line 3&lt;BR /&gt;awk: illegal statement near line 3&lt;BR /&gt;awk: syntax error near line 8&lt;BR /&gt;awk: illegal statement near line 8&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;awk -F'|' 'BEGIN {okb="/tmp/outok"; fab="/tmp/fail"; g=0;b=0;lim=100000}&lt;BR /&gt;{ if (buf) print buf&amp;gt;outf&lt;BR /&gt;if($1 == "C") sub("^C","R")&lt;BR /&gt;buf=$0&lt;BR /&gt;if (NF==19) { g++; outf=(okb""int(g/lim))}&lt;BR /&gt;else {b++; outf=(fab""int(b/lim))}&lt;BR /&gt;}&lt;BR /&gt;END {if (buf) {sub("^R","X",buf);print buf &amp;gt;outf} }' infile</description>
      <pubDate>Mon, 12 Mar 2007 17:25:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958996#M291488</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-12T17:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958997#M291489</link>
      <description>&lt;!--!*#--&gt;&amp;gt;&amp;gt; This is an urgent production request, not much time for learning curve. My script skills are very limited. I appreciate any help.&lt;BR /&gt;&lt;BR /&gt;And I do hope you get all the help you need,&lt;BR /&gt;but I can not help but feel worried about an organization which relies on best effort from a bunch of geeks and self proclaimed wizards like myslef to help with 'urgent production problems'.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Can someone help me?&lt;BR /&gt;&lt;BR /&gt;Sure, for mere money I'll be glad to solve this problem. Be sure to contact me!.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; if($1 == "C") sub("^C","R")&lt;BR /&gt;&lt;BR /&gt;I think you'll be {} around the conditional part after the if, and a ; after teh next line?&lt;BR /&gt;&lt;BR /&gt;imho this is not beyong a one-line and should be recoded as a little awk script.&lt;BR /&gt;&lt;BR /&gt;See my UNTESTED re-org below...&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;BEGIN {&lt;BR /&gt;    okb="/tmp/outok"; &lt;BR /&gt;    fab="/tmp/fail"; &lt;BR /&gt;    g=0;&lt;BR /&gt;    b=0;&lt;BR /&gt;    lim=100000&lt;BR /&gt;    }&lt;BR /&gt;    &lt;BR /&gt;{   if (buf) { print buf&amp;gt;outf}&lt;BR /&gt;     if($1 == "C") { sub("^C","R") }&lt;BR /&gt;        buf = $0;&lt;BR /&gt;        if (NF==19) { &lt;BR /&gt;          g++; &lt;BR /&gt;          outf=(okb""int(g/lim))&lt;BR /&gt;          } else {&lt;BR /&gt;       b++; &lt;BR /&gt;       outf=(fab""int(b/lim))&lt;BR /&gt;       }&lt;BR /&gt;        }&lt;BR /&gt;END {&lt;BR /&gt;  if (buf) {&lt;BR /&gt;    sub("^R","X",buf);&lt;BR /&gt;    print buf &amp;gt;outf&lt;BR /&gt;    } &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Mar 2007 18:08:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958997#M291489</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-12T18:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958998#M291490</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;a plain copy out of my ITC answer into a shell worked well - do you use that code not under HP-UX? For Solaris a call to 'nawk' or '/usr/xpg4/bin/awk' is required.&lt;BR /&gt;&lt;BR /&gt;Additional '{}' are not required, ';' only when rearranging the lines of the code: a newline is an implicit semicolon.&lt;BR /&gt;&lt;BR /&gt;I support Hein's suggestion to put the awk core program into an extra file, myprog.awk e.g. . Use&lt;BR /&gt;awk -F'|' -f myprog.awk infile&lt;BR /&gt;&lt;BR /&gt;in this case.&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Tue, 13 Mar 2007 07:33:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958998#M291490</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-03-13T07:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958999#M291491</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt;You are correct.  I am working in Solaris 8.0 box.  But the script will implemented in HP-UX 11.23.  Currently I have limited access to HP box.  I will try to see if I can run this in the HP or make changes to the code as per your comments.&lt;BR /&gt;&lt;BR /&gt;Thanks for all your help.&lt;BR /&gt;&lt;BR /&gt;Hein,&lt;BR /&gt;&lt;BR /&gt;Thanks you for offering your services.  Please send me your contact information. We can discuss it.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Mar 2007 08:09:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3958999#M291491</guid>
      <dc:creator>sheevm</dc:creator>
      <dc:date>2007-03-13T08:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: script tips help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3959000#M291492</link>
      <description>I have my Email in my forum profile.&lt;BR /&gt;It is all 16 characters of my name together at gmail or hotmail.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein van den Heuvel&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Mar 2007 08:15:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-tips-help/m-p/3959000#M291492</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-13T08:15:26Z</dc:date>
    </item>
  </channel>
</rss>

