05-06-2015 02:48 PM
Hello All,
I am getting data like -4.11139E-06-2.20064E-013.15263E+01-1.18792E-05-3.72294E-025.50947E+024.60728E-05-1.00468E-01-1.07451E-08431-50-628-03.
I want to split this string to
a = -4.11139E-06
b = -2.20064E-01
c = 3.15263E+01
d = -1.18792E-05
e = -3.72294E-02
f = 5.50947E+02
g = 4.60728E-05
h = -1.00468E-01
i = -1.07451E-08
Then ignore 431-50-628-03 from the output.
Thank you very much in advance.
Solved! Go to Solution.
05-06-2015 03:15 PM - edited 05-06-2015 03:17 PM
05-06-2015 03:48 PM
What are you getting that output from? Maybe we can fix it before you get it as this string.
05-06-2015 09:07 PM
Hi,
The good thing is that the numbers in the string all have the same format - they end in E+xy or E-xy. So you can search for the E and then extract the next three values. Then put the remaining string into a shift register of a While loop and iterate on it until there are no more E's. Take a look at my example.
Steve
05-07-2015 07:19 AM
All,
Thanks for the assistance. The proposed solutions from Ben64 and Steve_G are pricesly what I was looking for.
Ben64, just a note, the code works like I want it to with the "?". When the "?" is excluded, about 3 of the last elements are not picked
05-07-2015 07:52 AM
05-07-2015 07:59 AM
Oh, you did not attach a VI, or screenshot of the front panel, to your initial response. So I could not tell exactly what you had in the string control. I just used my values.
05-07-2015 08:33 AM
05-07-2015 09:02 AM
Oh that's a useful and convenient feature. Thank you for pointing that out.