LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Splitting a Concatenated String??

In "Write Labview Measurement File.vi" there is a tab for Comment. I have several Text boxes that are concatenated to the Comment Tab. I have a problem splitting that long string into respective components when it is read in another vi. The strings are of variable length. It appears that I am trying to unbundle the large string without knowing what I am doing.
0 Kudos
Message 1 of 3
(3,462 Views)
If you have added a comment to the file and want to read it and separate it into different substrings later on you will need to include a separator in the comment you write. Otherwise there is no way the other functions will know how to "unbundle" it (since it's not bundled but concatinated...).

The separator can be e.g. ".", ";", CRLF, Tab or whatever suits you best. Then you'll need to have a function somewhere that splits the string into it's componants based on the separators.
0 Kudos
Message 2 of 3
(3,462 Views)
Good afternoon, RL

There are a couple of ways to approach this. One is to use some sort of filler so that each segment in the concatenation is the same length (analogous to "bit stuffing") in numeric format.) You can then use a simple offset in a string split vi. Perhaps a more elegant means is to use a unique delimiter...use characters that have no Labview significance, and then use the Search String vi to "de-concatenate" the string. You can also use the "unbundle by name" vi, but you have to convert the data from string to numeric, and then back again...perhaps a bit overkill for your application.

Hope these suggestions are useful. Good luck!

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 3 of 3
(3,462 Views)