From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-26-2013 08:42 AM
Hi community,
I have an input string in which I have numbers between the <ele> and <\ele> tags. I'd like to extract all these numbers into a numeric array. While I have no problem to realize this function with some of the basic VIs of LabVIEW, somehow I have a gut feeling that there is a more elegant way to do it (maybe using the scan from string node)
I have attached the screenshot of my current solution. Please advise.
Thanks,
i-
12-26-2013 08:56 AM - edited 12-26-2013 08:57 AM
Not much more condensed, but this is how you should do it with Scan From String.
12-26-2013 01:51 PM
My solution works completely fine, but I believe the scan from string method is more intuitive as it is more visible what are we exactly searching for in the format options input. (so whoever reads the code doesnt have to put the pieces together like in my version)
Kudos!
12-26-2013 05:56 PM
Personally I prefer using regular expressions for matching. They are much more flexible. Notice this will work for various forms of the input. In addition, the code below uses fewer operations (no need for a second or third pattern match. You do end up with an extra element at the end of the array but that is easy to strip off.
12-27-2013 07:23 AM