读体积大的TXT文件
Private Sub Command1_Click()Dim Buff As String, FileLine() As String, i As Integer
Open "C:\aaa.txt" For Binary As #1
Buff = String(LOF(1), Chr(0))
Get 1, , Buff
Close #1
FileLine = Split(Buff, vbCrLf)
For i = 0 To UBound(FileLine)'总行数UBound(FileLine)+1
List1.AddItem FileLine(i)'单行显示
Next i
End Sub
看不懂,表示有鸭梨! 一次读到内存,在内存中分隔处理再显示? gdzhou 发表于 2011-9-26 19:02 static/image/common/back.gif
一次读到内存,在内存中分隔处理再显示?
Buff是一个变量,全部在内存里面的,一般分配在虚拟内存,如果读取的TXT文件大于10G的话,一样的很慢~ 一次读到内存?都说了体积大了,那样内存还不爆了啊 ~~有10G大的tet文件吗???里面该多少字啊~~ 我刚学VB不久,想了解一下
页:
[1]