文件太大出现问题,求解决
我是这样的打开一个txt文件进行读写操作,我试过打开一个小文件还可以,但是大文件出现问题了,说明一下我的这个txt文件有6M,求解决
这是代码,看看喔
Private Sub Command1_Click()
Dim c, s As String
Dim i, j, a As Integer
Dim x As Boolean
Open "C:\Documents and Settings\Administrator\桌面\1.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, c
If (Mid(c, 1, 1) = "卷" Or Mid(c, 1, 1) = "第") Then
x = True
i = 0
For j = 2 To Len(c)
If (Mid(c, j, 1) = "零") Then
i = i + 0
ElseIf (Mid(c, j, 1) = "0") Then
i = i * 10
ElseIf (Mid(c, j, 1) = "一" Or Mid(c, j, 1) = "1") Then
i = i + 1
ElseIf (Mid(c, j, 1) = "二" Or Mid(c, j, 1) = "2") Then
i = i + 2
ElseIf (Mid(c, j, 1) = "三" Or Mid(c, j, 1) = "3") Then
i = i + 3
ElseIf (Mid(c, j, 1) = "四" Or Mid(c, j, 1) = "4") Then
i = i + 4
ElseIf (Mid(c, j, 1) = "五" Or Mid(c, j, 1) = "5") Then
i = i + 5
ElseIf (Mid(c, j, 1) = "六" Or Mid(c, j, 1) = "6") Then
i = i + 6
ElseIf (Mid(c, j, 1) = "七" Or Mid(c, j, 1) = "7") Then
i = i + 7
ElseIf (Mid(c, j, 1) = "八" Or Mid(c, j, 1) = "8") Then
i = i + 8
ElseIf (Mid(c, j, 1) = "九" Or Mid(c, j, 1) = "9") Then
i = i + 9
ElseIf (Mid(c, j, 1) = "十") Then
i = i * 10
ElseIf (Mid(c, j, 1) = "百") Then
i = i * 10
ElseIf (Mid(c, j, 1) = "卷") Then
i = i
Else: x = False
End If
Next j
End If
Open "d:\" & Str(i) & ".txt" For Append As #2
Print #2, c
Close #2
Loop
Close #1
If x = True Then
End If
End Sub