The strtok_r() function if the thread_safe version of strtok(). It is far more complex to use, and las a much larger code footprint. For a single threaded system, why are you using strtok_r() instead of strtok()?
String Filename = "50000,3720,42.5";
What kind of file name is that?
char buf[Filename.length()];
Filename.toCharArray(buf,Filename.length());
Why are you insisting on wrapping the character data in a String when you have to extract it to use it?
- Why does this miss out the last number from Filename (ie the 5)?
Because you are missing a \0 as a delimiter.
- What does str become? Is it a character array?
It doesn't become anything. It is, and always will be a pointer to a character. For the most part, it is treated as an array.
Im having difficulty extracting just the '5000' before I then will convert it to a float for use elsewhere in my code
Does that have anything to do with the fact that you overwrite str in the while loop? 50000 is not a float. It is an integer (technically, a long int). Why do you want to convert it to a float?