Question saving data from text file to different variable

jtham

New member
Joined
Mar 30, 2010
Messages
3
Programming Experience
Beginner
hi, how do i save data from a text file to different variable?
i want to save each data from different rows and columns to different variable

example of the data in the text file

338 18 2
29 15 3
45 13 2
40 13 3
310 13 2
351 34 3
6 43 2
101 10 3
28 26 4
337 24 3
 
Do you know exactly how many values will be in the file? Will it be the same number every time? If not then you can't use distinct variables because you don't know how many to declare. Even if you do know, it may well still be a good idea to use either a 2D array or a jagged array to maintain the same logical layout as the file.
 
Back
Top