Dave, 56, 53, 32,1,22,6,5
I have this csv file that I would like to put in a 2d array.
Private Sub GetElement()
'Read the data from the cv file
Dim fileIn As String = "mel.csv"
Dim fileRows(), fileFields() As String
Dim count As Integer = 0
textBox.Text = String.Empty
If File.Exists(fileIn) Then
Dim fileStream As StreamReader = File.OpenText(fileIn)
fileRows = fileStream.ReadToEnd().Split(Environment.NewLine)
For i As Integer = 0 To fileRows.Length - 1
fileFields = fileRows(i).Split(",")
If fileFields.Length >= 2 Then
For x As Integer = 0 To fileFields.Length - 1
If x = 0 Then
For e As Integer = 0 To fileFields.Length
count = count + 1
textBox.Text = fileIn & " not found."
Catch ex As Exception
textBox1.Text = ex.Message
I was able to receive the first line only and then I have added it to a list box. In the MainWindow class I have declared two list of string to store the column and rows.