Convert string of variable length to floats.

PaulS:
You have several problems. First, and foremost:

  char buf[7];

defines an array that can hold 7 characters.

while ((n = file.read(buf, sizeof(buf))) > 0)

sizeof(buf), therefore, returns 7, so you are asking the file.read() function to move 7 characters into buf.
The records in the file are arranged in a stream, containing
nn.nnnn.nnnn.nn...
So, for the first call, you are asking for "nn.nnn" to be read. Then, you are asking for "n.nnnn". Then, "nnnn.".

Hey PaulS, I count 7 characters here - "nn.nn" :slight_smile:

But the array should definitely be 8 characters long so the OP can null terminate the string.