473,549 Members | 2,543 Online
Bytes | Software Development & Data Engineering Community
+ 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 9862
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
33019
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. From here read a character, print it, move the file pointer (FILE*) to 2 steps back (using fseek(fp, -2, SEEK_CUR)) to read the previous character. ...
50
4896
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 -- the character input is a different matter, at least if I want to remain within the bounds of the standard library.
4
5959
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 the data in. However, it takes about 20 seconds to complete and I wonder if there is a faster way. For example, I found that I could use 'fread'...
6
6326
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 browsing through this group and other sources on the web, it seems that there are many ways to do it. Some suggest that simply fseek'ing to 8K bytes...
1
1937
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 around this issue? Ultimate goal is to read text files as big as 50mb or more. I'm using the "input type=file " to upload file, and then using...
3
8278
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 200-500mb large and the problem is that it taket to long to parse them. I use textreader.readline and split on spases, and then I use that infrormation.
0
1622
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 with randon access file class makes reading very slow. Is there any alternative to random access files class in java whereby faster file processing...
20
4236
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 is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black...
1
1568
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 average. some of them are extra large. The data that I have to read will always be at the bottom and will be in the last 5 -20 line in the files...
0
7461
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5381
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1068
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
776
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.