06-17-2013 07:28 PM
Hello All.
As indicated in the title, I am trying to read part of an array element.
What I'm doing is reading values from a LeCroy scope using a "write" than "read" I have returned the read values into an array but the issue is the scope returns a value "1, 52.33E-3"
I simply want the element to be 52.33 that way I can use that for other calculations.
For example my array is.
"1, 34.334E-3"
"1, 53.343E-3"
"1, 143.232E-"
And I want it to be
34.334
53.343
143.232
Thanks!
Solved! Go to Solution.
06-17-2013 07:40 PM
Use the string functions (Match Pattern) to find the comma. Then convert the part after the comma to a number using the appropriate String to Number function.
Are you throwing away what looks like an exponent intentionally?
The last string appears to be missing the exponent. This hints that you may have problems with your communications with the instrument.
Lynn
06-18-2013 09:38 AM
Another option is to use Spreadsheet String to Array and use the comma as the delimiter. It can actually change your string into an array of numbers. Then you just index out the number you want.
06-18-2013 11:07 AM
@crossrulz wrote:
Another option is to use Spreadsheet String to Array and use the comma as the delimiter.
Not if he wants to throw away the exponent part. That would get parsed into the number with your suggestion.
06-18-2013 11:45 AM
Thanks I used the Match Pattern string function using "1," as the regular expression, then used the "Fract/Exp String to Number".
As for the exponent I left it in there. The reason I left the "-3" in my question is because once the value exceeds 1 second the instrument returns the read with the last character missing. "1, 1104.323E". But this should not be an issue.