How to index a String


#1

Hi

I have a file with data that I want to import in my JUCE-application; the data is formatted the following way:

9.398085e-002 1.879617e-001 9.398085e-002 1 5.308254e-016 3.956613e-002 1 2.000000e+000 1.000000e+000 1 -7.077672e-016 4.464627e-001 (all data in one row)

I do the following to read the data values:

[code]…
String ss = coefFile.loadFileAsString();

myTextEditors[0]->insertTextAtCursor(T(“Coefficients = “)+String(ss.getDoubleValue()) +T(” \n”));

[/code]Which works well for the first value but I can’t seem to index my way through to the remaining ones.

Can someone please explain me how to do this?

Thomas


#2

you should look into StringArray and the addTokens method

http://www.rawmaterialsoftware.com/juce/api/classStringArray.html#87fb7188e63ab95d50f2ae405ee8ae20


#3

[quote=“atom”]you should look into StringArray and the addTokens method

http://www.rawmaterialsoftware.com/juce/api/classStringArray.html#87fb7188e63ab95d50f2ae405ee8ae20[/quote]

Thanks, this is just great!

Thomas