If I understand correctly, you want to parse a file with a matrix of float values. You want to determine the dimensions by reading the file and storing them in a float[][]. Here what I believe you want: