01-31-2014 10:14 AM - edited 01-31-2014 10:19 AM
is there any way to overwrite an String? I mean, like in any programming language when you do:
String data = "abc";
data = "zxc";
I'm trying to get substrings from a initial string like "123.456.789.432.567" separating them by the '.' character, and when at the first iteration I get "123" I don't know how to init the second iteration with "456.789.432.567" as I can't change the initial string the process gets.
Thanks
Solved! Go to Solution.
01-31-2014 10:20 AM
I think you need a shift register in your loop to pass a value to the next iteration.
And you also need this:
http://www.ni.com/academic/labview_training/
01-31-2014 10:21 AM
01-31-2014 10:23 AM
How are you getting the first substring? Search/Split String? That function has an input to tell it where to start searching (offset). It will also tell you where the match it found was. Using those, you should be able to parse the data.
The way I would do it would be to use the Spreadsheet String To Array function with "." as the delimiter. That will give you an array of the strings you want. Use autoindexing tunnels or Index Array to get the one you want.
01-31-2014 10:25 AM
Please post what you have tried so far. It is much easier for us to help you learn by pointing out how to improve what you have than to just give you a solution.
Hint: Shift register and Match Pattern with after substring wired to the right shift register terminal will do most of what you want. There are several other ways which might be effective as well, depending on what else the program is doing with the data. (Spreadsheet
String to Array with period for delimiter for example).
Lynn
01-31-2014 11:05 AM - edited 01-31-2014 11:17 AM
A quick detour through vi.llb\Advanced String\ might help a bit with this.
but Crossrulz's method has merit too.
That period can be a tricky delimiter!
01-31-2014 11:19 AM
Regular Expressions wild cards.
Cameron
01-31-2014 11:41 AM - edited 01-31-2014 11:41 AM
Jeff·Þ·Bohrer wrote:but Crossrulz's method has merit too.
You don't need the Index Array in my solution if you actually wire a 1D Array of strings into the "array type" input of the Spreadsheet String To Array.
02-01-2014 11:11 AM
thank you guys, with all explained here I fixed the problem!