I am trying to read in a log file on the fly. I need to buffer about 50 lines and match data in the log and perform an operation based up that match. Here is a sample transaction from the logfile.
==============================================
CALL_INIT 2008/09/08 15:21:56.958
TRAN_ID deadbeeffe3
CGI 310-26-1-1
CHAN N/A
CHAN_MODE Speech Version 2 (EFR)
CHAN_TYPE TCH/EFR
SUB_CHAN 0
TIMESLOT 3
TSC 4
HOPPING Enabled
MAIO 0
HSN 0
MA 528,529,530,531,532,533,534,542,543,544,545
ENCR N/A
SESSION_KEY N/A
RESPONSE_TIME 20000 ms
==============================================
CALL_RESPONSE 2008/09/08 15:21:59.223
TRAN_ID deadbeeffe3
CGI 310-26-1-1
PLR_RESPONSE_TIME 20000 ms
Px,Py = bfbc76e04a8768e2,3faca2020f5a215b
UNCERTAINTY MAJOR 0x2 (2 m)
UNCERTAINTY MINOR 0x2 (2 m)
CONFIDENCE 70 %
TYPE OF SHAPE 3
LOCATION METHOD 8
==============================================
I basically have to look at the call init, and see if the channel type is TCH, when I see that I look for the Call Response with the same transaction ID, then I output the px, py to another file, or a c program. If the call init channel type is something else, I do nothing. Any ideas?
Thanks!
Josh
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.