in reply to Re: Comparing Dates and Reoccurance - Part II
in thread Comparing Dates and Reoccurance - Part II

Hi mr_mischief,

I would like to thank you sincerely for helping me and guiding me around to manage this task which was a mid term assignment from our local C/S lecturer, whom I think should go for another refresher course for presentation.

The log file is provided as it is, which was direct raw data provided by the tollbooth machines.


According to your code, it seems that you are interested only in two r +ecords next to one another. I draw this conclusion because if you hav +e three records on the same channel and ID, you'll not be able to tel +l if, for example, the third one and the first one are more than an h +our apart. Is that really what you want? The only scenario that immed +iately explains to me the session code you're using is a periodic tas +k completion, like traveling a circular route and crossing a start/fi +nish line or passing a token back and forth on a network.

The complete daily logfiles which was handed over measured more than 20,000 lines and if there are 3 records next to one another, i won't be able to identify the real time gap.

<b>quote</b> I might just need more info to understand this, but there seems to be +issues with the logging method. There's no indication in the informat +ion you present as to what's a start record and what's a stop record, + yet you consider any pair of matching IDs with no likewise matching +IDs between them a "record". Yet if you have more than two, you'll be + considering the first and second as a session record, the second and + the third as a session record, and the third and the fourth... Unles +s you're absolutely sure you'll never have more than two lines with t +he same ID (like if it's a unique session ID), then you're counting m +ore sessions than you have. OTOH, if you're guaranteed to never have +more than two lines with the same ID, then why do you need a count of + the occurrences for that ID? Are you timing network connections, lap + times around a track, stops at physical tool booths on a highway, or + what?

The task for the script is to analyse raw data pulled from physical tool booths on a highway, so there are records that may consists of a identical TIDS/class passing thru a particular channel/lane. now what exactly is TIDS/class, i reckon it is class of vehecle or even car registration number in that sense.

Now to complicated the matter, the lecturer given want to have a text file, to include a list of TIDS characters, so that the script is only to scan for these TIDS and ignore the rest.

in SQL statement, it may look like this :

select * from records where tids = ( xxxxxxxx,xxxxxx,xxxxxx ... ) # <--- read from TIDS file and channel = seven and time > 3600