08-27-2019 04:55 PM
How can I split a string range into a list or an array
say
1002..1004,1009,1100..1102
to a list like
1002, 1003, 1004, 1009, 1100, 1101 ,1102
or an array
Solved! Go to Solution.
08-27-2019 05:02 PM - edited 08-27-2019 05:27 PM
Can you guarantee that the input is well formed (all integers, comma delimited singles, ".." delimited ranges (not "." or "..."), no weird other characters, all one single line, all ranges going from smaller to bigger, etc.
In that case, seems easy. What have you tried so far?
08-27-2019 05:21 PM - edited 08-27-2019 05:23 PM
08-27-2019 05:35 PM
And to allow ranges in both directions, here's how you would modify the default case.
08-27-2019 06:25 PM
08-29-2019 04:16 PM
@DanlB wrote:
I was hoping for a nice clean function.
I made a parser that works but it is definitely not clean
a couple of your parsing ideas simplified my version
thanks
Make it into a subVI.