Opening csv-File via ADO-connection - Column Limitation to 255 / or just use another file type?

后端 未结 1 873
花落未央
花落未央 2020-12-20 03:55

I have quite a large csv-File (about 800MB) which I need to access from an Excel File via VBA (I am using Excel 2010) to run some calculations. Now I would like to avoid ope

相关标签:
1条回答
  • 2020-12-20 04:14

    3000 seems big, but there is a kludge:

    Dim FileNum As Integer
    Dim DataLine As String
    Dim SplitData()
    
    
    FileNum = FreeFile()
    Open "Filename" For Input As #FileNum
    
    While Not EOF(FileNum)
        Line Input #Filename, DataLine ' read in data 1 record at a time
        SplitData = Split(DataLine, ",")
        'Process big array
    Wend
    

    each row read of your data will be into field1SplitData(0) to field3000SplitData(2999) (zero based array)

    0 讨论(0)
提交回复
热议问题