Binary Data (originally txt file) to Double or Float Array

I am trying to load in data from a set of text files in the format:
0.0000011321
0.0000000121
-0.000000032
etc.

I have marked them as binary resources in Projucer, so they are stored as giant “const char *” arrays in BinaryResources.cpp. How do I convert this to 1 array of doubles/floats?

You could use StringArray::fromLines() to create an array of strings from the binary data, then call String::getFloatValue() on each string to convert it to a float.

2 Likes

This worked perfectly!! Thanks so much for your help :slight_smile: