|
-
Apr 5th, 2002, 04:59 PM
#1
Thread Starter
New Member
Text files too big for VB to handle
I am trying to write a program that loads a text file into
a richtextbox control by looping through the text one line
at a time. Each line is first compared with a default value,
say "". If the line matches then Don't print it to the screen.
When I run my code with small files it works just fine, but
when I run the code on a 2M text file, it takes hours. In fact
I've never seen it finish on pass on this file. There has to be
a more efficient method than the one I'm using.
Dim m_filename As String
Dim FileData As String
Dim TotalFile As String
Open m_filename For Input As #1
Do While Not EOF(1)
Line Input #1, FileData
If FileData = "" Then
' Do nothing
Else
TotalFile = TotalFile & FileData & vbCrLf
End If
Loop
RichTextBox1.Text = TotalFile
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|