<?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: shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876454#M935115</link>
    <description>Of course I'd prefer perl (I just used a2p (awk to perl translator) and stripped out the crap and modified the substr's (perl strings start at position 0 whereas awk starts at 1))&lt;BR /&gt;&lt;BR /&gt;If your input files are huge then you should use perl for speed!&lt;BR /&gt;&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;&lt;BR /&gt;$prevline = '';&lt;BR /&gt;$prevdata = '';&lt;BR /&gt;$nextdata = '';&lt;BR /&gt;$lineno = 0;&lt;BR /&gt;$badlineno = 0;&lt;BR /&gt;$goodlineno = 0;&lt;BR /&gt;$badlines = '';&lt;BR /&gt;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    chomp;      # strip record separator&lt;BR /&gt;    #&lt;BR /&gt;    # increment line number&lt;BR /&gt;    #&lt;BR /&gt;    $lineno += 1;&lt;BR /&gt;    #&lt;BR /&gt;    # does it match our pattern?&lt;BR /&gt;    #&lt;BR /&gt;    if ($_ =~ /^\#\@\#/ ) {&lt;BR /&gt;        #&lt;BR /&gt;        # save the bad line number&lt;BR /&gt;        $badlineno = $lineno;&lt;BR /&gt;&lt;BR /&gt;        #&lt;BR /&gt;        # save the previous lines data&lt;BR /&gt;        $prevdata = substr($prevline, 5, 4);&lt;BR /&gt;        #&lt;BR /&gt;        if ($goodlineno) {&lt;BR /&gt;            $badlines = '';&lt;BR /&gt;        } else {&lt;BR /&gt;            # in case we have a long run of bad lines - like&lt;BR /&gt;            # the entire file, save this special string for&lt;BR /&gt;            # printing later - hopefully the input file isnt&lt;BR /&gt;            # huge or this program will blow chunkies&lt;BR /&gt;            $badlines = $badlines . $lineno . " null null\n";&lt;BR /&gt;        }&lt;BR /&gt;        #&lt;BR /&gt;        # if the previous data is null then change the word to "none"&lt;BR /&gt;        if ($prevdata eq '') {&lt;BR /&gt;            $prevdata = 'none';&lt;BR /&gt;        }&lt;BR /&gt;    } else {&lt;BR /&gt;        #&lt;BR /&gt;        # save the good line number&lt;BR /&gt;        $goodlineno = $lineno;&lt;BR /&gt;        #&lt;BR /&gt;        # if we previously had a bad line then report the data  &lt;BR /&gt;        if ($badlineno) {&lt;BR /&gt;            #&lt;BR /&gt;            # save the current lines data for potential use&lt;BR /&gt;            # the next time we encounter a bad record&lt;BR /&gt;            $nextdata = substr($_, 5, 4);&lt;BR /&gt;            print $badlineno, " ", $prevdata, " ", $nextdata, "\n";&lt;BR /&gt;            $badlineno = 0;&lt;BR /&gt;            $prevdata = '';&lt;BR /&gt;            $nextdata = '';&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;    $prevline = $_;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;if ($badlineno) {&lt;BR /&gt;    if ($goodlineno) {&lt;BR /&gt;        print $badlineno, " ", $prevdata, " none\n";&lt;BR /&gt;    } else {&lt;BR /&gt;        print $badlines;&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
    <pubDate>Wed, 15 Jan 2003 14:19:44 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2003-01-15T14:19:44Z</dc:date>
    <item>
      <title>shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876434#M935095</link>
      <description>we have a data file as &lt;BR /&gt; followes. and bad records starts with #@# &lt;BR /&gt;&lt;BR /&gt;$cat data.txt&lt;BR /&gt;ABCD    2044440A0023C637          &lt;BR /&gt;ABCD    2044440B0023C638          &lt;BR /&gt;#@#               23C63A            - 3rd record is bad   &lt;BR /&gt;ABCD    63744440X023C63B          &lt;BR /&gt;ABCD    22044440Y023C63C   &lt;BR /&gt;ABCD    2044740B0023C638          &lt;BR /&gt;#@#               23C63A             - 7th record is bad   &lt;BR /&gt;ABCD    2033440A0023C637&lt;BR /&gt;&lt;BR /&gt;      -&amp;gt;|  |&amp;lt;-    &lt;BR /&gt;          &lt;BR /&gt;i need to write a script to log &lt;BR /&gt;  the info in a file (error.log) &lt;BR /&gt;&lt;BR /&gt;1. which will tell/display the position of &lt;BR /&gt;   bad record (starts with #@#) &lt;BR /&gt;&lt;BR /&gt;2. and i need to know the &lt;BR /&gt;   before after records of bad record.&lt;BR /&gt;&lt;BR /&gt;3. I need only  from 8 to 12 (length) of those &lt;BR /&gt;   before  and after records ( as shown in arrows)&lt;BR /&gt;&lt;BR /&gt;basically, I have to generate the error log&lt;BR /&gt; for the above data file as followes.&lt;BR /&gt;&lt;BR /&gt;$cat error.log&lt;BR /&gt;postion  before    after &lt;BR /&gt;3        2044       6374&lt;BR /&gt;7        2044       2033&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;check the attachment for datafile . &lt;BR /&gt;Thnx in advance&lt;BR /&gt;Vasu&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Jan 2003 20:14:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876434#M935095</guid>
      <dc:creator>vas  bolpali</dc:creator>
      <dc:date>2003-01-07T20:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876435#M935096</link>
      <description>how about something like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;awk 'BEGIN {prevhit=0;prevline="";lineno=0}&lt;BR /&gt;{&lt;BR /&gt;   lineno+=1;&lt;BR /&gt;   if (match($0,/^\#\@\#/)) {&lt;BR /&gt;      print lineno-1,prevline;&lt;BR /&gt;      print lineno,$0;&lt;BR /&gt;      prevhit=1;&lt;BR /&gt;   } else {&lt;BR /&gt;      if (prevhit) {&lt;BR /&gt;         print lineno,$0;&lt;BR /&gt;         prevhit=0;&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;   prevline=$0;&lt;BR /&gt;}&lt;BR /&gt;END {if (prevhit) {print "endofdatafile";}}'&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 07 Jan 2003 20:52:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876435#M935096</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-07T20:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876436#M935097</link>
      <description>Damn this site is very slow today! Anyways I forgot to add the out sample:&lt;BR /&gt;&lt;BR /&gt;# cat data.txt | ./data.awk&lt;BR /&gt;2 ABCD 2044440B0023C638&lt;BR /&gt;3 #@# 23C63A - 3rd record is bad&lt;BR /&gt;4 ABCD 63744440X023C63B&lt;BR /&gt;6 ABCD 2044740B0023C638&lt;BR /&gt;7 #@# 23C63A - 7th record is bad&lt;BR /&gt;8 ABCD 2033440A0023C637&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 07 Jan 2003 21:09:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876436#M935097</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-07T21:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876437#M935098</link>
      <description>Thnx for the reply.&lt;BR /&gt;you are almost close&lt;BR /&gt;&lt;BR /&gt;DATA=data.txt&lt;BR /&gt;ERR=error.log &lt;BR /&gt;&lt;BR /&gt;the error.log must have 3 columns.&lt;BR /&gt;&lt;BR /&gt;1 column- bad record position in the data file&lt;BR /&gt;2 column- before record ( may be full or substr)&lt;BR /&gt;3 column- after record ( may be full or substr)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;the error.log out put should be like this &lt;BR /&gt;&lt;BR /&gt;3 2044 6374 &lt;BR /&gt;7 2044 2033 &lt;BR /&gt;&lt;BR /&gt;vasu.&lt;BR /&gt;see the exact datafile in the attachment</description>
      <pubDate>Tue, 07 Jan 2003 22:07:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876437#M935098</guid>
      <dc:creator>vas  bolpali</dc:creator>
      <dc:date>2003-01-07T22:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876438#M935099</link>
      <description>Thnx for the reply.&lt;BR /&gt;you are almost close&lt;BR /&gt;&lt;BR /&gt;DATA=data.txt&lt;BR /&gt;ERR=error.log &lt;BR /&gt;&lt;BR /&gt;the error.log must have 3 columns.&lt;BR /&gt;&lt;BR /&gt;1 column- bad record position in the data file&lt;BR /&gt;2 column- before record ( may be full or substr)&lt;BR /&gt;3 column- after record ( may be full or substr)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;the error.log out put should be like this &lt;BR /&gt;&lt;BR /&gt;3 2044 6374 &lt;BR /&gt;7 2044 2033 &lt;BR /&gt;&lt;BR /&gt;vasu.&lt;BR /&gt;see the exact datafile in the attachment</description>
      <pubDate>Tue, 07 Jan 2003 22:08:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876438#M935099</guid>
      <dc:creator>vas  bolpali</dc:creator>
      <dc:date>2003-01-07T22:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876439#M935100</link>
      <description>Hi Vasu,&lt;BR /&gt;&lt;BR /&gt;Try this one. Replace datafile with your file and logfile with the output file. Also change cut statement based on how many chars you want.&lt;BR /&gt;&lt;BR /&gt;-Sri&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;DATA=datafile                                                        &lt;BR /&gt;LOG=logfile                                                          &lt;BR /&gt;LINE=1                                                               &lt;BR /&gt;printf "%-10.10s %-10.10s %-10.10s \n" POSITION BEFORE AFTER &amp;gt; $LOG  &lt;BR /&gt;printf "%-10.10s %-10.10s %-10.10s \n" -------- ------ ----- &amp;gt;&amp;gt; $LOG &lt;BR /&gt;printf "\n" &amp;gt;&amp;gt; $LOG                                                  &lt;BR /&gt;while read ENTRY                                                     &lt;BR /&gt;do                                                                   &lt;BR /&gt;PREV=0                                                               &lt;BR /&gt;NEXT=0                                                               &lt;BR /&gt;echo $ENTRY |grep "#@#"                                              &lt;BR /&gt;if [ $? = 0 ]                                                        &lt;BR /&gt;then                                                                 &lt;BR /&gt;(( PREV = $LINE - 1 ))                                               &lt;BR /&gt;(( NEXT = $LINE + 1 ))                                               &lt;BR /&gt;POSITION="$LINE"                                                     &lt;BR /&gt;BEFORE=$(sed -n ''$PREV'p' $DATA |cut -c 6-9)                        &lt;BR /&gt;AFTER=$(sed -n ''$NEXT'p' $DATA|cut -c 6-9)                          &lt;BR /&gt;printf "%-10d %-10d %-10d \n" $LINE $BEFORE $AFTER &amp;gt;&amp;gt; $LOG           &lt;BR /&gt;fi                                                                   &lt;BR /&gt;(( LINE = $LINE + 1 ))                                               &lt;BR /&gt;done &amp;lt; $DATA                                                        &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 07 Jan 2003 23:57:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876439#M935100</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-01-07T23:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876440#M935101</link>
      <description>Create a perl script-&lt;BR /&gt;&lt;BR /&gt;$good=" *BOF";&lt;BR /&gt;while(&amp;lt;&amp;gt;) {&lt;BR /&gt; chomp;&lt;BR /&gt; if (/^#\@#/) { push(@bad,$.); }&lt;BR /&gt; dump();&lt;BR /&gt; $curr=substr($_,7,5);&lt;BR /&gt; $good=$curr;&lt;BR /&gt;}&lt;BR /&gt;$curr=" *EOF";&lt;BR /&gt;dump();&lt;BR /&gt;&lt;BR /&gt;sub dump {&lt;BR /&gt;  if (scalar @bad) { &lt;BR /&gt;   foreach $badline (@bad) {&lt;BR /&gt;    print "$badline $good $curr\n";&lt;BR /&gt;   }&lt;BR /&gt;   undef @bad;&lt;BR /&gt;  }&lt;BR /&gt;  return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;----------------&lt;BR /&gt;Then run-&lt;BR /&gt;perl yourscript datafile &amp;gt;error.log&lt;BR /&gt;&lt;BR /&gt;This will handle if their are mutiple bad lines in a row.&lt;BR /&gt;It will also handle if the first or last line is bad.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 08 Jan 2003 00:01:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876440#M935101</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-01-08T00:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876441#M935102</link>
      <description>couple of minor changes. &lt;BR /&gt;&lt;BR /&gt;Replace&lt;BR /&gt;&lt;BR /&gt;echo $ENTRY |grep "#@#"&lt;BR /&gt;&lt;BR /&gt;with&lt;BR /&gt;&lt;BR /&gt;echo $ENTRY |grep "#@#" &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Remove  &lt;BR /&gt;&lt;BR /&gt;POSITION="$LINE"&lt;BR /&gt;&lt;BR /&gt;I didn't use it.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Wed, 08 Jan 2003 00:01:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876441#M935102</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-01-08T00:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876442#M935103</link>
      <description>Ignore previous perl script, this is the correct script I meant to enter-&lt;BR /&gt;&lt;BR /&gt;$good=" *BOF"; &lt;BR /&gt;while(&amp;lt;&amp;gt;) { &lt;BR /&gt;chomp; &lt;BR /&gt;if (/^#\@#/) { push(@bad,$.); } &lt;BR /&gt;else { &lt;BR /&gt;$curr=substr($_,7,5);&lt;BR /&gt;dump();&lt;BR /&gt;$good=$curr; &lt;BR /&gt;}&lt;BR /&gt;} &lt;BR /&gt;$curr=" *EOF"; &lt;BR /&gt;dump(); &lt;BR /&gt;&lt;BR /&gt;sub dump { &lt;BR /&gt;if (scalar @bad) { &lt;BR /&gt;foreach $badline (@bad) { &lt;BR /&gt;print "$badline $good $curr\n"; &lt;BR /&gt;} &lt;BR /&gt;undef @bad; &lt;BR /&gt;} &lt;BR /&gt;return; &lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 08 Jan 2003 00:17:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876442#M935103</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-01-08T00:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876443#M935104</link>
      <description>Hi Vasu,&lt;BR /&gt;try the attached script, using your input file as $1.&lt;BR /&gt;You can modify the STRING variable if the requested chars are not correct.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Jan 2003 12:05:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876443#M935104</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-01-08T12:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876444#M935105</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Perhaps a shorter one ...&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;nl -s^V data.txt | awk -F^V '{&lt;BR /&gt;  if (match($2,/#@#/))&lt;BR /&gt;  {&lt;BR /&gt;    printf "%d %s", $1, substr(prev, 8, 5)&lt;BR /&gt;    getline&lt;BR /&gt;    printf " %s\n", substr($2, 8, 5)&lt;BR /&gt;  }&lt;BR /&gt;  prev=$2&lt;BR /&gt;}' &amp;gt; error.log&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 08 Jan 2003 12:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876444#M935105</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-01-08T12:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876445#M935106</link>
      <description>Vasu,&lt;BR /&gt;&lt;BR /&gt;Try this, I modified the data a little in case the FIRST or LAST record was bad:&lt;BR /&gt;&lt;BR /&gt;# cat data.txt             &lt;BR /&gt;#@# 23C63A - 1 st record is bad&lt;BR /&gt;ABCD 2044440B0023C638&lt;BR /&gt;#@# 23C63A - 3rd record is bad&lt;BR /&gt;ABCD 63744440X023C63B&lt;BR /&gt;ABCD 22044440Y023C63C&lt;BR /&gt;ABCD 2044740B0023C638&lt;BR /&gt;#@# 23C63A - 7th record is bad&lt;BR /&gt;ABCD 2033440A0023C637 &lt;BR /&gt;ABCD 2044740B0023C638&lt;BR /&gt;#@# 23C63A - 10th record is bad&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# cat data.awk&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;awk 'BEGIN {&lt;BR /&gt;   prevline=""; prevdata=""; nextdata=""; lineno=0; badlineno=0;&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;   lineno+=1;&lt;BR /&gt;   if (match($0,/^\#\@\#/)) {&lt;BR /&gt;      badlineno=lineno; &lt;BR /&gt;      prevdata=substr(prevline,6,4);&lt;BR /&gt;      if (prevdata == "") prevdata="none";&lt;BR /&gt;   } else {&lt;BR /&gt;      if (badlineno) {&lt;BR /&gt;         nextdata=substr($0,6,4);&lt;BR /&gt;         print badlineno,prevdata,nextdata;&lt;BR /&gt;         badlineno=0;&lt;BR /&gt;         prevdata="";&lt;BR /&gt;         nextdata="";&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;   prevline=$0;&lt;BR /&gt;}&lt;BR /&gt;END {if (badlineno) {print badlineno,prevdata,"none";}}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# cat data.txt | ./data.awk&lt;BR /&gt;1 none 2044&lt;BR /&gt;3 2044 6374&lt;BR /&gt;7 2044 2033&lt;BR /&gt;10 2044 none&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 08 Jan 2003 13:32:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876445#M935106</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-08T13:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876446#M935107</link>
      <description>I gave only the basic info .&lt;BR /&gt;&lt;BR /&gt;but john korterman 's script does exactly what i need in full  .&lt;BR /&gt;&lt;BR /&gt;Sridhar gave me exactly , what i asked , &lt;BR /&gt;but in reality it went up to 80% only .&lt;BR /&gt;&lt;BR /&gt;and thanks all of you .&lt;BR /&gt;&lt;BR /&gt;Vasu.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Jan 2003 18:56:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876446#M935107</guid>
      <dc:creator>vas  bolpali</dc:creator>
      <dc:date>2003-01-08T18:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876447#M935108</link>
      <description>hi John, &lt;BR /&gt;The shell script is not handling , if all the records are bad.&lt;BR /&gt; check the attachment for tha data file.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jan 2003 20:49:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876447#M935108</guid>
      <dc:creator>vas  bolpali</dc:creator>
      <dc:date>2003-01-14T20:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876448#M935109</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;awk 'BEGIN {&lt;BR /&gt;   prevline=""; prevdata=""; nextdata=""; lineno=0; badlineno=0; goodlineno=0;&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;   lineno+=1;&lt;BR /&gt;   if (match($0,/^\#\@\#/)) {&lt;BR /&gt;      badlineno=lineno; &lt;BR /&gt;      prevdata=substr(prevline,6,4);&lt;BR /&gt;      if (prevdata == "") prevdata="none";&lt;BR /&gt;   } else {&lt;BR /&gt;      goodlineno=lineno;&lt;BR /&gt;      if (badlineno) {&lt;BR /&gt;         nextdata=substr($0,6,4);&lt;BR /&gt;         print badlineno,prevdata,nextdata;&lt;BR /&gt;         badlineno=0;&lt;BR /&gt;         prevdata="";&lt;BR /&gt;         nextdata="";&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;   prevline=$0;&lt;BR /&gt;}&lt;BR /&gt;END {&lt;BR /&gt;if (badlineno) {&lt;BR /&gt;   if (goodlineno) {&lt;BR /&gt;      print badlineno,prevdata,"none";&lt;BR /&gt;   } else {&lt;BR /&gt;      print "All lines are bad";&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;}'&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 14 Jan 2003 21:05:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876448#M935109</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-14T21:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876449#M935110</link>
      <description>no ,&lt;BR /&gt;if all records are bad , still i need err &lt;BR /&gt;report/output like this .&lt;BR /&gt;(assuming total 50 ,&lt;BR /&gt; and all are bad)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;1 null null &lt;BR /&gt;2 null null&lt;BR /&gt;3 null null&lt;BR /&gt;......&lt;BR /&gt;50 null null &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Jan 2003 21:16:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876449#M935110</guid>
      <dc:creator>vas  bolpali</dc:creator>
      <dc:date>2003-01-14T21:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876450#M935111</link>
      <description>If you go back to my perl script above, it will handle when all lines are bad.&lt;BR /&gt;&lt;BR /&gt;1 *BOF *EOF&lt;BR /&gt;2 *BOF *EOF&lt;BR /&gt;...&lt;BR /&gt;50 *BOF *EOF&lt;BR /&gt;&lt;BR /&gt;The only difference is I used *BOF and *EOF to represent beginning file and ending file.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 14 Jan 2003 21:28:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876450#M935111</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-01-14T21:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876451#M935112</link>
      <description>hi Rod&lt;BR /&gt;u r perl script (perlx) is giving errors&lt;BR /&gt;&lt;BR /&gt;$ perl perlx data.txt &amp;gt; error.log   &lt;BR /&gt;&lt;BR /&gt;syntax error in file perlx at line 8, next 2 tokens "dump("&lt;BR /&gt;&lt;BR /&gt;syntax error in file perlx at line 13, next 2 tokens "dump("&lt;BR /&gt;&lt;BR /&gt;Execution of perlx aborted due to compilation errors.&lt;BR /&gt;&lt;BR /&gt;Vasu</description>
      <pubDate>Tue, 14 Jan 2003 22:44:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876451#M935112</guid>
      <dc:creator>vas  bolpali</dc:creator>
      <dc:date>2003-01-14T22:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876452#M935113</link>
      <description>Whoops, I think "dump" is a reserved name in perl. Try renaming "dump" to "dispit".&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 14 Jan 2003 23:10:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876452#M935113</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-01-14T23:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876453#M935114</link>
      <description>Try this attached awk script:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 15 Jan 2003 13:43:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2876453#M935114</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-15T13:43:02Z</dc:date>
    </item>
  </channel>
</rss>

