Here we Split each line in a file using the File.ReadAllLines Function and Split. We have a comma-separated-values (CSV) file. We first read in the file with ReadAllLines.
Imports System.IO
Module Module1
Sub Main()
Dim i As Integer = 0
' Loop through each line in array returned by ReadAllLines.
For Each line As String In File.ReadAllLines(
"example.txt")
' Split line on comma.
Dim parts As String() = line.Split(New Char() {
","c})
' Loop over each string received.
For Each part As String In parts
' Display to console.
Console.WriteLine(
"{0}:{1}", i, part)
Next
i += 1
Next
End Sub
End Module
frontal,parietal,occipital,temporal
pulmonary artery,aorta,left ventricle
0:frontal
0:parietal
0:occipital
0:temporal
1:pulmonary artery
1:aorta
1:left ventricle