array is ok, looping is off

I believe your file is getting into your array ok, but when you are looping through it, you are only saving the last row.

The loop splits the row fine, but does nothing with the values until it terminates. At that point the values are set to whatever was found in the last row.

Incidentally - you don't have to read the file into an array - you can loop across your <file> this...