Read csv file in vb 6 line by line

The following example show how we can read csv (comma-separated values) file in vb 6 code:

Private Sub ReadCSV_InVB6()
        Dim fileName As String
        Dim fileNum As Integer
        fileName = "test.csv"
        fileNum = FreeFile
        Dim fileData As String
        Dim fileLines() As String
        Dim fileColumns() As String
        Dim i As Integer
        Dim j As Integer
        Open fileName For Input As #fileNum
        fileData = Input(LOF(fileNum), #fileNum)
        Close #fileNum
        fileLines = Split(fileData, vbCrLf)
        For i = 0 To UBound(fileLines) - 1
            'Split each column into an array
            fileColumns = Split(fileLines(i), ",")
            'Loop through each column
            For j = 0 To UBound(fileColumns) - 1
                'Do whatever you want with this data
            Next j
       Next i
End Sub