<?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: Perl solution for reading multi lines error search pattern in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244644#M676992</link>
    <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;Thank you very much. I got exactly what is expected. Many many thanks for your help as usual. You have been a good mentor for honing my perl skills.</description>
    <pubDate>Mon, 21 Jun 2010 14:13:17 GMT</pubDate>
    <dc:creator>Srikanth Arunachalam</dc:creator>
    <dc:date>2010-06-21T14:13:17Z</dc:date>
    <item>
      <title>Perl solution for reading multi lines error search pattern</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244638#M676986</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I need to consolidate a reconcillation file based on errors received from standard oracle SQL*Loader log file. In case of SQL*Loader logfile, the error message for single rejected record is spawned as 5 error messages. For example, rejected record 10 appears as &lt;BR /&gt;Record 10: Rejected - Error on table "CFSOWNER"."SUA_MT", column FEES_AMT_IND.&lt;BR /&gt;ORA-01400: cannot insert NULL into (FEES_AMT_IND)&lt;BR /&gt;SQL*Loader-522: lfiopn failed for file (/transfer/linktest/estath/scripts/ods/loader/bad/LOADED_ASFGH.DAT.bad.1)&lt;BR /&gt;SQL*Loader-552: insufficient privilege to open file&lt;BR /&gt;SQL*Loader-509: System error: Permission denied&lt;BR /&gt;SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.&lt;BR /&gt;&lt;BR /&gt;Based on SQL*Loader error logfile, I want to generate a short version reconcillation information that would give me info like&lt;BR /&gt;Record10|ORA-01400: cannot insert NULL into (FEES_AMT_IND)|&lt;BR /&gt;Record15|&lt;ERROR message="" from="" multiple="" lines=""&gt;&lt;/ERROR&gt;&lt;BR /&gt;Please note that I am interested only on ORA- error and not on SQL*Loader error.&lt;BR /&gt;&lt;BR /&gt;Another level of information is I should be able to scan record 10 in LOADED_ASFGH.DAT and get the first 15 characters in the feedfile in a loop.&lt;BR /&gt;So output should be like.&lt;BR /&gt;Record10|ORA-01400: cannot insert NULL into (FEES_AMT_IND)|&lt;FIRST 15="" chars="" of="" record10=""&gt;&lt;/FIRST&gt;Record15|ORA-01400:..&lt;BR /&gt;records are like &lt;BR /&gt;111465550005060                30/04/20100000000001003 UKP           29632.99&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Srikanth A</description>
      <pubDate>Mon, 21 Jun 2010 10:22:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244638#M676986</guid>
      <dc:creator>Srikanth Arunachalam</dc:creator>
      <dc:date>2010-06-21T10:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Perl solution for reading multi lines error search pattern</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244639#M676987</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;A post of a portion of the *actual* files (not pasted here where the forum may mangle things) would lead to a better response.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 21 Jun 2010 10:56:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244639#M676987</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-06-21T10:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Perl solution for reading multi lines error search pattern</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244640#M676988</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;As requested I am attaching the feed file and logfile to be scanned and generate a output file. Please advice.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Srikanth Arunachalam</description>
      <pubDate>Mon, 21 Jun 2010 11:43:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244640#M676988</guid>
      <dc:creator>Srikanth Arunachalam</dc:creator>
      <dc:date>2010-06-21T11:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Perl solution for reading multi lines error search pattern</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244641#M676989</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Sorry to have missed the feedfile.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Srikanth</description>
      <pubDate>Mon, 21 Jun 2010 11:44:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244641#M676989</guid>
      <dc:creator>Srikanth Arunachalam</dc:creator>
      <dc:date>2010-06-21T11:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Perl solution for reading multi lines error search pattern</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244642#M676990</link>
      <description>&lt;!--!*#--&gt;Hi (again) Srikanth:&lt;BR /&gt;&lt;BR /&gt;Based on your data, you could do:&lt;BR /&gt;&lt;BR /&gt;# cat ./myfilter&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my ( @pieces, $line );&lt;BR /&gt;{&lt;BR /&gt;    local $/ = undef;&lt;BR /&gt;    @pieces = split( /(?=Record\s+\d+:)/, &amp;lt;&amp;gt; );&lt;BR /&gt;}&lt;BR /&gt;for $line (@pieces) {&lt;BR /&gt;    if ( $line =~ m{(Record\s+\d+).+?(ORA.+?)SQL}s ) {&lt;BR /&gt;        print "$1|$2";&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;# ./myfilter mylog&lt;BR /&gt;Record 10|ORA-01400: cannot insert NULL into (FEES_AMT_IND)&lt;BR /&gt;Record 15|ORA-01400: cannot insert NULL into (FEES_AMT_IND)&lt;BR /&gt;Record 21|ORA-01400: cannot insert NULL into (FEES_AMT_IND)&lt;BR /&gt;&lt;BR /&gt;As for the second part of your question, does "...scan record 10..." simply mean "read record #10" and append the first 15-characters to the above output?&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Jun 2010 13:45:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244642#M676990</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-06-21T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Perl solution for reading multi lines error search pattern</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244643#M676991</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;I am going to assume that for the second part of your question, does "...scan record 10..." simply mean "read record #10" and append the first 15-characters to the above output.  If so, overall, you might do:&lt;BR /&gt;&lt;BR /&gt;# cat ./myfilter&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my ( @pieces, $line, @lookup );&lt;BR /&gt;{&lt;BR /&gt;    my $feedfile = '/tmp/myfeed';&lt;BR /&gt;    open( my $fh, '&amp;lt;', $feedfile ) or die "Can't open '$feedfile': $!\n";&lt;BR /&gt;    while (&amp;lt;$fh&amp;gt;) {&lt;BR /&gt;        chomp;&lt;BR /&gt;        push( @lookup, substr( $_, 0, 14 ) );&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;    local $/ = undef;&lt;BR /&gt;    @pieces = split( /(?=Record\s+\d+:)/, &amp;lt;&amp;gt; );&lt;BR /&gt;}&lt;BR /&gt;for $line (@pieces) {&lt;BR /&gt;    if ( $line =~ m{(Record\s+(\d+)).+?(ORA.+?)\sSQL}s ) {&lt;BR /&gt;        print $1, "|", $3, "|", $lookup[ $2 - 1 ], "\n";&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;# ./myfilter mylog&lt;BR /&gt;Record 10|ORA-01400: cannot insert NULL into (FEES_AMT_IND)|11465550005060&lt;BR /&gt;Record 15|ORA-01400: cannot insert NULL into (FEES_AMT_IND)|11465550005060&lt;BR /&gt;Record 21|ORA-01400: cannot insert NULL into (FEES_AMT_IND)|11465550005060&lt;BR /&gt;&lt;BR /&gt;Please note that I hard-coded the name for the "feeder" data.  You can embellish this as needed.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 21 Jun 2010 14:11:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244643#M676991</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-06-21T14:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Perl solution for reading multi lines error search pattern</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244644#M676992</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;Thank you very much. I got exactly what is expected. Many many thanks for your help as usual. You have been a good mentor for honing my perl skills.</description>
      <pubDate>Mon, 21 Jun 2010 14:13:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244644#M676992</guid>
      <dc:creator>Srikanth Arunachalam</dc:creator>
      <dc:date>2010-06-21T14:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Perl solution for reading multi lines error search pattern</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244645#M676993</link>
      <description>Completely satisfied with the response.</description>
      <pubDate>Mon, 21 Jun 2010 15:55:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-solution-for-reading-multi-lines-error-search-pattern/m-p/5244645#M676993</guid>
      <dc:creator>Srikanth Arunachalam</dc:creator>
      <dc:date>2010-06-21T15:55:11Z</dc:date>
    </item>
  </channel>
</rss>

