I have multiple values Separated by commas in a single index of an Array That is One Dimensional i.e
value(0) = (M1,1500KM,0.5$), value(1) = (M2,2400KM,0.75$)
Then I want to put these into a Multi Dimensional Array so that
twoDarr(1,0) = 1500KM , twoDarr(1,1) = 2400KM
And so on What am I Doing Wrong here?
Module Module1
Sub Main()
Dim FileName, i As String
Dim c, e As Integer
Dim h(7, 3) As String
FileName = "D:\_Docx\Motorways.csv"
'read the lines into an array
Dim lines As String() = System.IO.File.ReadAllLines(FileName)
Dim Motorway = From line In lines
Let data = line.Split(",")
Select New With {.MID = data(0),
.Length = data(1),
.Cars = data(2),
.Toll = data(3),
.Lanes = data(4)}
For c = 0 To 8
For e = 0 To 4
i = lines(c)
h(e, c) = i.Split(",")
Console.WriteLine(h(e, c))
Next
Next
End Sub
End Module
I Tried this Loop but it Returns the Error: BC30311 Visual Basic Value of type 'String()' cannot be converted to 'String'.
For c = 0 To 8
For e = 0 To 4
i = lines(c)
h(e, c) = i.Split(",")
Console.WriteLine(h(e, c))
Next
Next