Re: Need help with parsing a multilined log file into objects
- From: "Stephany Young" <noone@localhost>
- Date: Wed, 10 Jan 2007 18:26:13 +1300
Yes! - Any instance of that class is your target object.
"Paulers" <SuperGh0d@xxxxxxxxx> wrote in message
news:1168405015.003441.265060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Yes I pasted this straight from the log file. all messages begin with a
timestamp. The timestamp is always in the same format
(\d{2}:\d{2}:\d{2})
Im sorry I dont understand what you mean by definition of the target
object. I basically have a class with properties set and getters that I
would like to populate for each object. Is that what you would like to
see?
thanks for your help! :)
Stephany Young wrote:
To recap:
Does the data in the log file look EXACTLY like that?
Is there actually a newline betewen 'Control Message (=' and 'Message
Type'?
Does the timestamp, ('03:34:06') mark the start of the message?
Does the timestamp, ('03:34:06') mark the start of EVERY message?
Is the timestamp ALWAYS in the SAME format?
Please post the definition of the target object.
"Paulers" <SuperGh0d@xxxxxxxxx> wrote in message
news:1168403061.767940.71980@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The type of messages I want to extract from the log look like this
(type 101's) but not all messages are in the same format. I would like
to extract the values and populate an opject with the same properties
and store them in a collection that I can iterate through. I just do
not know how to get the values for each of these type 101 messages into
their own objects.
03:34:06 server12 Trace: [ 384]abox1->bbox1: Control Message (=
Message Type 101); Message Length 921 bytes
Get Call (= Subtype 9); DialogueID: (2007) 000007d7;
SendSeqNo: (1)00000001
Trunk Group ID: (1) 00000001
Trunk Number: 3
Service ID: (0) 00000000
Dialed Number: INTELLI_CARE
ANI: 1111111111
Called Number: 8000025225
DNIS: 8000025225
Stephany Young wrote:
What is the message delimiter and what is the field delimiter?
In addition, please post a sample of the logfile and the definition of
the
target object.
"Paulers" <SuperGh0d@xxxxxxxxx> wrote in message
news:1168395270.670571.150900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I have a log file that contains many multi-line messages. What is
the
best approach to take for extracting data out of each message and
populating object properties to be stored in an ArrayList? I have
tried
looping through the logfile using regex, if statements and flags to
find the start and end of each message but I do not see a good time
in
this process to create a new instance of my Message object. While
messing around with it I tried to create a new instance in different
places of the loops but when I try to populate it I can not access
the
object from within some if statements but not in others. I am
wondering
if there is a better approach perhaps one that is more abstract and
takes advantage of OOP. Has anyone done something like this before,
if
so I'd love to hear about your approach.
thanks
.
- References:
- Need help with parsing a multilined log file into objects
- From: Paulers
- Re: Need help with parsing a multilined log file into objects
- From: Stephany Young
- Re: Need help with parsing a multilined log file into objects
- From: Paulers
- Re: Need help with parsing a multilined log file into objects
- From: Stephany Young
- Re: Need help with parsing a multilined log file into objects
- From: Paulers
- Need help with parsing a multilined log file into objects
- Prev by Date: Re: Need help with parsing a multilined log file into objects
- Next by Date: Re: Opening a specific form with a string
- Previous by thread: Re: Need help with parsing a multilined log file into objects
- Next by thread: Re: Need help with parsing a multilined log file into objects
- Index(es):
Relevant Pages
|