The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
get Message from file within date range ambharish UNIX for Dummies Questions & Answers 2 06-29-2007 05:20 PM
compare date with date in file siog UNIX for Dummies Questions & Answers 2 10-04-2006 12:10 PM
compare today's date with date in a file siog UNIX for Dummies Questions & Answers 4 10-04-2006 11:55 AM
Report file extraction based on Date range ganapati Shell Programming and Scripting 2 07-13-2006 11:26 AM
Need to print file names in a certain date range using ls Shamwari UNIX for Dummies Questions & Answers 2 10-08-2001 07:14 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-05-2006
mojo24 mojo24 is offline
Registered User
  
 

Join Date: May 2006
Posts: 1
Log File date compare for user defined range

Hi i am a noob and need a little help to finish my shell script. I am learning as i go but hit a problem.

I am search thorugh logs(*.rv) files to find entires between two user defined dates,

The script so far looks for the "START" and "END" of each entry at sees if it belongs To user defined ORGID number. then only take the whole record based on OGID and valid entry in the date range given


gawk '/^START/ { ok=0; sec="" } /^START/,/^END/ { sec=sec "\n" $0 }$2==274529 { ok=1 }/^END/ && ok { print sec }' *.rv>BUSORG_ORGID${BUSORG_ORGID}st${START_DAY}${START_MONTH}end${END_DAY}${END_MONTH}.txt



extract of one *.rv file

START: Mon Apr 24 10:09:19 2006:
Mon Apr 24 10:09:19 2006: service: before tpcall(), buffer being sent...
G_FLAG 0
CLFY_SUB ListBeneficiaryDetails
MESSAGE_ID C7ADAC68-DD9E-497D-BCBD-9654B9AFEDB6
BUSORG_ORGID 281688

service: now I'm sending that...
Mon Apr 24 10:09:19 2006: Mon Apr 24 10:09:20 2006: service: after tpcall(), buffer received...
E_NUMBER 2
G_FLAG 0
CLFY_SUB ListBeneficiaryDetails
E_STRING No record(s) found
MESSAGE_ID C7ADAC68-DD9E-497D-BCBD-9654B9AFEDB6
BUSORG_ORGID 281688

service: now I have received that...
Mon Apr 24 10:09:20 2006: service: field [XFDTRANSACT_XID2] not found, Ferror 4, tperrno 0
processing ends... Mon Apr 24 10:09:20 2006:
END:
START: Mon Apr 24 10:09:53 2006:
Mon Apr 24 10:09:53 2006: service: before tpcall(), buffer being sent...
CLFY_SUB ListLast50CardStatementItems
MESSAGE_ID ACDD0695-77CA-4C5F-931A-036075DFF927
BUSORG_ORGID 422345
XPRODUCT_XACCOUNTNO 570203327
XPRODUCT_XCOINTYPE DUAM
END:
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0