Need to extract numeric data from a string of ascii
cdbass
0.17758E+01 -0.14488E+01 -0.41742E+00 0.85527E+00 -0.47925E-01 -0.51596E+00 0.65037E-05 0.10000E+01 0.69302E+02
I don't have much control over the output format for this data string, except that I have the option of writing the file in binary, but I'm not ready to make that leap yet.
I would like to read in the line and extract each numeric value. I'm fairly new at igor, and I'm having difficulties getting the string functions to do what I want of them. Useful help or advice would be appreciated :)
Also, do you have more information about your options with regards to writing the file in binary? It's possible that loading the data from a binary file would actually be easier than loading it from a text file.
November 21, 2008 at 11:16 am - Permalink
sscanf str, "%e%e%e%e%e%e%e%e%e",xpos,ypos,zpos,ucos,vcos,wcos,erg,wgt,tme
where xpo, ypo, ... , tme are my variables.
This (brute force method) will work for my purposes.
November 21, 2008 at 01:03 pm - Permalink
November 21, 2008 at 09:08 pm - Permalink
November 22, 2008 at 06:49 am - Permalink