Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie: Find and replace events in log file

0 views
Skip to first unread message

Jack B. Pollack

unread,
Jan 13, 2011, 8:47:40 AM1/13/11
to
I am a complete newbie to this but was able to cobble together a logging
script that takes my string passed to the script
(www.mywebsite.com/test?SomeData) and appends it to the end of a file. So
basically now I am creating a long text file of logged data.

This takes a long time to load into a browser as the file grows in size.
Since I am only logging about 20 decree events and don't care about the
history, just the last occurrence, I would like to modify the script to
replace the previous event with the same name if it already exists (or add
it if it is new)

Eg.

Event id 1 1-5-11 5:30:00
Event id 7 1-4-11 9:20:20
Event id 2 1-7-11 4:21:56
Event id 6 1-2-11 8:21:30


New event:: Event id 7 1-12-11 4:56:22

This is currently getting tacked on to the bottom of the file. I would like
to detect that there is already an Event id 7 and replace it with the new
time stamp. Obviously if there is a new unique event I would like to append
it to the bottom of the file.

As I said earlier, I am really new to this and need real hand-holding on
this project.

Thanks


Jack B. Pollack

unread,
Jan 13, 2011, 10:07:38 AM1/13/11
to

"Jack B. Pollack" <N...@NE.nothing> wrote in message
news:PaSdncbW1Icen7LQ...@earthlink.com...

I guess if it is easy enough (and there is a built in function) I would also
like to compare the old date of the event with the new date.

eg:
Event id 7 1-4-11 4:56:22 xxxx (old event)
Event id 7 1-5-11 4:56:22 24 (new event dif between events in hours)


0 new messages