I want to place the contents of a CSV file into an array.
The csv file looks as follows:
CG.A1300.CB24.KREG176E,BEYYMMDD
CG.A1300.CB24.KREG176F,BFYYMMDD
CG.A1300.CB24.KREG90,BBYYMMDD
CG.A1300.CB24.KRG8183E,BDYYMMDD
CG.A1300.CB24.KPRODCON.RPT,BRYYMMDD
I want to put this into an array, but I need it to be split on the Comma so that the final result is the following.
Array(0,0) shows: CG.A1300.CB24.KREG176E
Array(0,1) shows: BEYYMMDD
And so on.
My code currently is this:
Expand|Select|Wrap|Line Numbers
- Dim Templookup() As String
- Dim reader As StreamReader
- Dim X, I As Integer
- 'Load the Lookup.csv.
- reader = New StreamReader("D:\Enbridgefiletest\Removable Hard drive\lookup.csv")
- X = 0
- Do
- ReDim Preserve Templookup(X)
- Templookup(X) = reader.ReadLine
- X = X + 1
- Loop Until reader.EndOfStream
- Dim lookup(X, 1) As String
- I = 0
Any help would be great!