flemi_p has asked for the wisdom of the Perl Monks concerning the following question:
<INFILE> 15:53:42.332 Dbg 10741 'App: 12' has put request id='834531' into queu +e 15:53:42.332 Dbg 10737 Forwarding request '834531' from 'App: 12' to ' +./dbclient_oracle: 12.1' 15:53:43.908 Dbg 10749 Forwarding response '834531.1' from './dbclient +_oracle: 12.1' to 'App: 12' 15:53:43.908 Dbg 10749 Forwarding response '834531.2' from './dbclient +_oracle: 12.1' to 'App: 12' 15:53:43.908 Dbg 10739 Oracle: id='12.1' req='834531' SQL: SELECT crf_ +routing.CRF_RT_ACD1_QUEUE,crf_routing.CRF_RT_ACD1_SIZE,crf_ro' +0551 Executed SQL statement 'SELECT', start retrieve records... +0826 MSG_RETRIEVED2 status='DBM_SUCCESS' +0826 MSG_RETRIEVED status='DBM_NOMORE'
<REQIDS_FILE> 834531 834532 834533
foreach $reqidline (<REQIDS_FILE>) { print "reqid - $reqidline\n"; $reqidline =~ s/ */|/g; + # Replace multiple spaces with pipe characters @reqidLineElements = split(/\|/,$reqidline); + # Split line elements into an array $count = 0 ; print "\tactual reqid - $reqidLineElements[0]\n"; foreach $inline (<IN_FILE>) { print "\tinline - $inline\n"; $reqidLineElement = $reqidLineElements[0] ; print "\textracted reqid - $reqidLineElement\n"; # if ($inline=~m/$reqidLineElement/) if (834531 == $reqidLineElement) { # Write the line from the log to output $count = 0 ; next ; print "\tMATCHED - $inline\n"; } if ( ($inline =~ /$reqidLineElements[0]/ ) and +( $inline =~ /SELECT/) ) { # Write current line to output print "\tSELECT - $inline\n"; # Initiate the reading of the next 3 li +nes from the log $counting = "true" ; $count = 0 ; next ; } if ( $counting eq "true" )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching numeric digits in strings
by davorg (Chancellor) on Jan 10, 2007 at 13:10 UTC | |
|
Re: Matching numeric digits in strings
by Samy_rio (Vicar) on Jan 10, 2007 at 12:37 UTC | |
by davorg (Chancellor) on Jan 10, 2007 at 12:53 UTC | |
by flemi_p (Novice) on Jan 10, 2007 at 14:48 UTC |