At 6:47 PM -0800 12/20/05, Matt Stevens wrote:
Christopher,

The log format docs seem to imply that the individual fields are contained in quotes. On my system at least that's not the case.

Just using spaces doesn't work too well, as the number of spaces between fields is variable and the messages in fields also contain spaces.

There are no quotes. It isn't that hard to scan, though. Jerry's response covered one approach well.

If I were scanning it, I would probably follow an algorithm something like this:

Scan for the first whitespace. What precedes it is the date. Scan past the whitespace. With what remains, scan for the next whitespace. What precedes it is the time. Scan past the whitespace. With what remains, scan for the next whitespace. What precedes it is the tag. Scan past the whitespace. If the tag is one of the tags that indicates the device message format, with what remains, scan for the "::". What precedes it is the full name. Scan past the :: and any whitespace. What remains on that line is the message. If the tag is one of the tags that indicates the "all others" format, then no further scanning is necessary--what remains on the line is the message.

If it would help, I could write a short perl script or C program that would demonstrate this.

-- Christopher

--
================================================
Christopher L. Sweeney
[EMAIL PROTECTED]
http://www.dartware.com/
____________________________________________________________________
List archives: http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [EMAIL PROTECTED]

Reply via email to