By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,694 Members | 1,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,694 IT Pros & Developers. It's quick & easy.

reading large text files faster?

P: n/a
I've been testing some of the example streamreads on 40 meg text file. I
notice that it take awhile to read in debug.write and textbox1.text multi
line.

but if i use a textpad program, example editplus, it loads a lot quicker.

My question is... what is the limitation here or is there something that
can be done different for faster reading?
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
vbnewbie wrote:
I've been testing some of the example streamreads on 40 meg text file. I
notice that it take awhile to read in debug.write and textbox1.text multi
line.

but if i use a textpad program, example editplus, it loads a lot quicker.

My question is... what is the limitation here or is there something that
can be done different for faster reading?


Are you trying to read the entire file in a once, or reading it line by
line in a loop?

Reading it in all at once is p[robably the "fastest" way, but also the
most memory-intensive. Reading it line by line will be slower, but also
more "gentle" on your memory usage.

HTH...
Chris
Nov 21 '05 #2

P: n/a
VBNewbie

In addition to Chris,

Try
ReadtoEnd
http://msdn.microsoft.com/library/de...toendtopic.asp

I hope this helps?

Cor

"vbnewbie" <te***@vbnewbie.com>
I've been testing some of the example streamreads on 40 meg text file. I
notice that it take awhile to read in debug.write and textbox1.text multi
line.

but if i use a textpad program, example editplus, it loads a lot quicker.

My question is... what is the limitation here or is there something that
can be done different for faster reading?

Nov 21 '05 #3

P: n/a
"vbnewbie" <te***@vbnewbie.com> schrieb:
I've been testing some of the example streamreads on 40 meg text file. I
notice that it take awhile to read in debug.write and textbox1.text multi
line.

but if i use a textpad program, example editplus, it loads a lot quicker.

My question is... what is the limitation here or is there something that
can be done different for faster reading?


Some text editors don't load the whole file. Instead, they only load the
part that is visible in the text editor (and some more parts). Imagine you
run your application on a machine with 128 MB of physical RAM and you load
an 100 MB file...

Notice that loading/displaying is much faster if you assign the whole
content to the textbox once instead of incrementally building up the
textbox's content.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.