Ok Im a beginner with VB. I understand programming algorithm but and I know some C++ but im stuck on a project I'm working on.
I have a csv file with 25 lines. Each line has a first name, last name, and then 5 number values. What im trying to do is extract those values from each line, and assign each one portion to 7 different arrays.
example:
First Last hw1 hw2 Project Midterm Final
------------------------------------------------
John, Smith, 80, 99, 98, 87, 95
Jim, Davis, 99, 98, 92, 100, 99
i need each first name in one array, each last name in another, each hw1 in another and so on. totalling 7 different arrays. If i could just figure out how to put these values into seperate arrays i could proceed, but im stuck. Im assuming i need some sort of loop.
this is what i have so far:
Dim record, temp(6), first(24), last(24), hw1(24), hw2(24), project(24), midterm(24), final(24) As String
Dim fname, lname As String
inFile = File.OpenText("grades.csv")
Do While (inFile.Peek <> -1)
record = inFile.ReadLine
temp = Split(record, ",")
Loop
Any help would be appreciated! thanks in advance!
I have a csv file with 25 lines. Each line has a first name, last name, and then 5 number values. What im trying to do is extract those values from each line, and assign each one portion to 7 different arrays.
example:
First Last hw1 hw2 Project Midterm Final
------------------------------------------------
John, Smith, 80, 99, 98, 87, 95
Jim, Davis, 99, 98, 92, 100, 99
i need each first name in one array, each last name in another, each hw1 in another and so on. totalling 7 different arrays. If i could just figure out how to put these values into seperate arrays i could proceed, but im stuck. Im assuming i need some sort of loop.
this is what i have so far:
Dim record, temp(6), first(24), last(24), hw1(24), hw2(24), project(24), midterm(24), final(24) As String
Dim fname, lname As String
inFile = File.OpenText("grades.csv")
Do While (inFile.Peek <> -1)
record = inFile.ReadLine
temp = Split(record, ",")
Loop
Any help would be appreciated! thanks in advance!