I would do that this way:
- Scan the file in order to find the minimum and maximum row and column indices. For simplicity sake, let's say the minima are zeroes and maxima are
- Create a bidimensional list having
(max_row + 1) rows and
(max_col + 1) columns. Initialise all the items of the bidimensional list with
- Scan the file again, assigning the proper value to the corresponding item of the bidimensional list (e.g.
0 3 .92 =>
m = .92.
That's all, folks.
Fixed the wrong column index, thanks to Patrice T