所以用以下直接開檔的方法
Sub READ_BIG_TEXT_FILE()
I = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\test\videos.htm", 1)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
ActiveSheet.Cells(I, 2).Value = strLine
I = I + 1
Loop
objFile.Close
End Sub
以下是參考方法 (對大TEXT FILE 無用)
Sub TEST()
Dim i As Long
Dim LineText As String
Open "C:\test\videos." For Input As #24
i = 2
While Not EOF(24)
Line Input #24, LineText
ActiveSheet.Cells(i, 2).Value = LineText
P = Split(Record, ",")
i = i + 1
Wend
Close #24
End Sub
沒有留言:
張貼留言