Re: what is the best way to read text file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Paul Clement (UseAdddressAtEndofMessage_at_swspectrum.com)
Date: 02/14/05


Date: Mon, 14 Feb 2005 10:31:20 -0600

On Mon, 14 Feb 2005 04:53:31 -0600, "Guoqi Zheng"<no@sorry.com> wrote:

¤ Dear sir/lady,
¤
¤ I need to process our web server log file every day. Normally, this file is about 50MB - 100s MB big. How can I read the file in a effective way.
¤
¤ I can open a streamreader to read it and use readline() function to read line by line and process them. However, this sounds very slow. I can also use readtoend to read everything into a string, but then I am afraid that it will be too big for memory.
¤
¤ How should I read the file?

Don't think I've ever seen the contents of this file. Does it have any type of structure? Does it
use field delimiters?

Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)