| Platform: | Visual Basic |
| Task: | Read and loop through a comma separated values file |
| Discussion: | Read and loop through a comma separated values file |
| Example: | Dim TextLine As String = ""
Dim SplitLine() As String
Dim objReader As New System.IO.StreamReader(CSVFile)
'burn through the lines in the file and split the contents out into an array
Do While objReader.Peek() <> -1
TextLine = objReader.ReadLine()
SplitLine = Split(TextLine, ",")
Debug.Print(SplitLine(0).ToString & vbNewLine)
Loop
|