423,867 Members | 3,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,867 IT Pros & Developers. It's quick & easy.

read fast txt line by lkine

P: 18
Sorry for my bad english:-)
i need to read txt file line by line with best fsted method...

my txt file is 142 Mb and contain approx 1.370.000 lines...
all lines have a fixed lenght 132 characters.

How to?
Feb 18 '18 #1
Share this Question
Share on Google+
6 Replies


twinnyfo
Expert Mod 2.5K+
P: 2,720
sal21,

What have you tried so far? This will give us a starting point to troubleshoot your work. We will not design the project for you.

Thanks.
Mar 1 '18 #2

P: 18
simply:
Private Sub ReadLines()
Dim MyLine As String
Open "C:\MyFile.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, MyLine
MsgBox MyLine
Loop
Close #1
End Sub
Mar 3 '18 #3

P: 18
simply:
Private Sub ReadLines()
Dim MyLine As String
Open "C:\MyFile.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, MyLine
MsgBox MyLine
Loop
Close #1
End Sub
Mar 3 '18 #4

P: 18
imply:
Private Sub ReadLines()
Dim MyLine As String
Open "C:\MyFile.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, MyLine
MsgBox MyLine
Loop
Close #1
End Sub
Mar 24 '18 #5

P: 2
I like writing like this.
open file for input as #1
input #1,a
close #1
c=1
while c=1
on error goto e
msgbox split(a,vbcrlf)(c)
c=c+1
wend
e:
msgbox "end"
Mar 25 '18 #6

P: 18
i'm not sure yuor code work....
Mar 25 '18 #7

Post your reply

Sign in to post your reply or Sign up for a free account.