Article View: comp.lang.basic.visual
Article #295Re: is this too much to handle for VB ?
From: ink
Date: Tue, 28 Dec 1999 00:00
Date: Tue, 28 Dec 1999 00:00
40 lines
2703 bytes
2703 bytes
Nick Jensen wrote... >Hi ALL , and Merry Christmas :-) > >At my work there's a little application running 24 hours 365 days of the >year >always writing a log file of some radio "data" transmission. I'ts all doing >a >nice job, except for a few lines in the log needs to be processed by some >3rd party software (which I'm working on :)). The problem is really the log >file itself , which is VERY large !, around 43.000 lines every 24 hours, of >course depending on the radio "Traffic" !. Every time a new line is >written to the log file I want my little program called "Logwatcher" to read >the line !, let's say the logfile is 33.000 lines BIG, and now is written >lines 33.000 to 33.017 , I want to read only the last added 17 lines ?? > >How can I Do that , in smart and FAST way ?? > >a few lines from the log file is attached here > >THx in advance > >Nick Jensen Maybe this is not the most elegant solution, but for a quick and dirty approach I'd do the following - 1. A time opens the file every, say few seconds (depending on the frequency with which the file is changed) and checks the exact file size, marks it as well as the number of lines in the file - have to run through it once, sorry. It's a sequential file anyway, so there's not much to do about it. 2. If the file size is bigger than the last time, read the file up to the old number of lines and then line input the rest of the file Hope this helps a little. Regards Kurt
Technical Details
Message-ID:
<849s75$eg6$1@pollux.ip-plus.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<g5S94.514$iq6.800@news.get2net.dk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110e3b,a47ce68fa8298b9d X-Google-Attributes: gid110e3b,public X-Google-Thread: f51ba,a47ce68fa8298b9d X-Google-Attributes: gidf51ba,public X-Google-Thread: f5f6f,a47ce68fa8298b9d X-Google-Attributes: gidf5f6f,public X-Google-Thread: f645d,a47ce68fa8298b9d X-Google-Attributes: gidf645d,public X-Google-Thread: fb992,a47ce68fa8298b9d X-Google-Attributes: gidfb992,public X-Google-Thread: 101986,a47ce68fa8298b9d X-Google-Attributes: gid101986,public From: "ink" <inkSPA@MMENOTrhone.ch> Subject: Re: is this too much to handle for VB ? Date: 1999/12/28 Message-ID: <849s75$eg6$1@pollux.ip-plus.net> X-Deja-AN: 565592217 References: <g5S94.514$iq6.800@news.get2net.dk> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: news@ip-plus.net X-Trace: pollux.ip-plus.net 946369573 14854 194.209.170.65 (28 Dec 1999 08:26:13 GMT) Organization: Swisscom IP+ (post doesn't reflect views of Swisscom) NNTP-Posting-Date: 28 Dec 1999 08:26:13 GMT Newsgroups: comp.lang.basic.visual,comp.lang.basic.visual.3rdparty,comp.lang.basic.visual.misc,comp.lang.visual.basic,dk.edb.programmering.basic.visual-basic,microsoft.public.vb