473,486 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

reading large text files faster?

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
3 9849
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
32984
by: sahukar praveen | last post by:
Hello, I have a question. I try to print a ascii file in reverse order( bottom-top). Here is the logic. 1. Go to the botton of the file fseek(). move one character back to avoid the EOF. 2....
50
4876
by: Michael Mair | last post by:
Cheerio, I would appreciate opinions on the following: Given the task to read a _complete_ text file into a string: What is the "best" way to do it? Handling the buffer is not the problem...
4
5953
by: Matthew Crema | last post by:
Hello, Say I have 1000 text files and each is a list of 32768 integers. I have written a C program to read this data into a large matrix. I am using fopen in combination with fscanf to read...
6
6314
by: Rajorshi Biswas | last post by:
Hi folks, Suppose I have a large (1 GB) text file which I want to read in reverse. The number of characters I want to read at a time is insignificant. I'm confused as to how best to do it. Upon...
1
1932
by: Hutty | last post by:
I have a program that open text files and compares them, however, when reading files larger than 500kb the programs seems to bomb. I get re-directed to "page not found". Any idea how to get...
3
8265
by: Jmc | last post by:
Hi I'm trying to build a log viewer, its going to be part of a contentmanagement system and needs some extra features that commersial logviewers donīt have. The log files (IIS log) are...
0
1616
by: kaminekutte | last post by:
Hi everybody, I have been trying to parse a 100MB log file(tab separated). Basic aim is to read the file randomly, do some procesing and then display the contents of the file line by line. Working...
20
4218
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
1
1564
by: akalmand | last post by:
Hi there, I am writing a code to read some data from the text files. The number of text files is not fixed and could be more that 15. the length of each file is large... close to 100,000 on an...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.