我正在尝试在 excel 中读取大(> 15MB)文件中的前几个字符。现在,我正在使用典型的:
Set MyObject = New Scripting.FileSystemObject
Set mySource = MyObject.GetFolder(mySourcePath)
For Each myFile In mySource.Files
With New Scripting.FileSystemObject
With .OpenTextFile(myFile, ForReading)
test_str = .ReadLine
'Do things
End With
End With
Next
问题在于大文件,我(相信)您将整个内容加载到内存中只是为了读取前几个字符。有没有办法只提取前 6 个字符?