Saving stream of floats on txt file

Hi everyone,
I am having hard time figure out how to save a stream of real-time floats coming from a device to a txt file.
I need the txt file to be very simple e.g.

etc… I tried with ofLog but the file saved contain also other information I can’t exclude.
I am trying with ofFile and ofBuffer but it doesn’t seem I can make it work nicely.
More specifically, I created an array of ofFIle, but I don’t understand how to assign a different file name to each file…

Any hint? I feel like there’s a simple solution but I can’t find it yet…

Thank you!

you can just do:

ofFile floats("floats.txt", ofFile::WriteOnly);
floats << ofToString(1.) << endl;
floats << ofToString(2.) << endl;
floats << ofToString(3.) << endl;

of course you can use any variable containing the numbers instead of the numbers themselves

@arturo I am linking this conversation to the other post