06-01-2015 02:36 PM
Ladies and Gentlemen -
I am attempting to extract an array of real values from a csv formatted string. The number of values is arbitrary. I am apparently goofing up the formatting string in the "Scan from String" function. If anyone could offer formatting advice I would be very grateful. The format of the string going INTO the "Scan from String" function is as follows:
-7.23570E+01,-8.99010E+01,-7.42040E+01,-9.09890E+01,-7.35500E+01,-1.09656E+02,-7.38520E+01, (and many values follow)
A Scan string I have attempted is [-+]%.5e[,], but all return "The input string does not contain data in the expected format."
Thank you again!!
Tony
Solved! Go to Solution.
06-01-2015 02:40 PM
Just use the Spreadsheet String To Array with the format set to "%f" and the delimiter set to a comma.
06-01-2015 02:47 PM
crossrulz suggestion is a good one.
If you're set on using Scan from String, the format specifier you want is "%.5e," and you want to read in a loop using a shift register to store the remaining string.
The [+-] is automatically handled in the specifier and you don't need to bracket the ending comma.
06-02-2015 06:33 AM
Folks -
Thank you for the solution!! She's a workin'...
Have a great day!!
Tony
06-02-2015 07:20 AM
Tony,
Whichever post (or posts) you considered gave you "the solution", please mark it as The Solution. We're not paid for being helpful, but it is the Kudos and Solution acknowledgements that keeps us coming back to help others.
Bob Schor
06-02-2015 07:30 AM
Bob -
Thanks for the pointer. Done.
T.