Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

using split string to break apart parens-delimited data string


cedgar Oct 5, 2017 07:32 PM

I'm having trouble reading a large string obtained via SerialInRecord into discrete variable.  The raw data string is separated by parens and has labels but not all variables are numeric.  For example:

(date 04/26/2017)(time 14:34)(var1 3.462)(var2 450.23)(var3 100.1)(var4 0.3432)....etc. 

I tried using SplitStr(output(),data_string_in,CH(40),2,4) to split based on the parens, but I think the non-numeric data messes it up, I get only NaN. 

I tried using the '0' option of SplitStr to extract only the numbers, but it doesn't seem to be able to capture all the variables, and is really unwieldy since the data string is quite long. 

I only need a handful of the variables, so could search for them by name or position, but can't figure that out either.  Thanks in advance, C


JDavis Oct 5, 2017 07:49 PM

Try SplitOption 6, with a filter string of "()". That will let it parse on either character.


cedgar Oct 5, 2017 08:36 PM

This seems to work.  I had to write it as "( )" with a space in between.  Thank you!  C

Log in or register to post/reply in the forum.