Hi Jotne,Thanks for the info..will use code tags from here on.What iam trying to achieve is..I have the below blocks of data which i want to find the max Job-id and start printing only the blocks and omitting the rest
My logic goes in this way
> find the pattern [0-9]{4,} [A-Z][a-z]{2,} [0-9]{2,} i.,e 2013 Jan 23 09
and get the job-id and line number of the file
> Take it in a variable and find the max jobid in the file.
> Now traverse the jobid in the same variable and find the startpt and the endpt.
> send this to the basic awk command
awk 'NR==STPT,NR=={ENDPT}-1' and print only the blocks.
Here i got struck at the last point when i try to split the values through " ",take it in an array and send as startpoint and endpoint.
Need your help.
I/p
2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd
2013 Jan 23 09:12:02:746 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107543 [UtilityService
Adapter.Request._Null_.vCustomer.1
ReplySubject:: _INBOX
2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd
2013 Jan 23 09:12:02:746 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
Adapter.Request._Null_.vCustomer.1
ReplySubject:: _INBOX
2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107543 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd
---------- Post updated at 07:16 AM ---------- Previous update was at 07:07 AM ----------
Sorry i didnt mention the o/p..The expected o/p should be the blocks with Job-107544.
o/p
2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd
2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd
2013 Jan 23 09:12:02:746 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
Adapter.Request._Null_.vCustomer.1
ReplySubject:: _INBOX