LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String of letters to 1-D Array of strings for spreadsheet

What I would like to do is be able to take this string as it is the A's and B's that are being generated as the program runs,
I would like to take this string and get it into file in delimited tabs just as the numbers are. If there is a created 1-D array of
strings that works, but that is controlled on the front panel, I would like to create this from data that is comming in. In other words
I am stuck on how to create a 1-D array of Sting from the string value comming in. I want to do this so that I can get all the different
values A's or B's into the different tab fields. As it is they are comming all up in the first column and not "tabbing" Please see the
attached file in the rows 5 an
d 7.

Thanks,

Brian
Download All
0 Kudos
Message 1 of 3
(2,579 Views)
I am not sure I understand the type of input that you have, but I think it is a string containing "A" or "B" characters with nothing in between them, from which you want to obtain an array of strings in which each element has a single "A" or "B" character, and then obtain a string with each character separated by a tab character. In the attached image you can see code to do both of these tasks.
If your input string is "A" and "B" characters separated by a space, or something else, you can simply use the Search and Replace String function, setting the "replace all?" input to true, and search for a space (or whatever is separating your characters), and replace all spaces with tabs.
Hope this helps.
Message 2 of 3
(2,579 Views)
Brian
You need to convert your string to contain single tabs as separator. The problem is that your string is "dirty", i.e. it contains a variable amount of spaces to seperate the items. If you strictly had single space separators, you could just replace all spaces with tabs.

"Scan string for tokens" by default does not allow empty tokens, thus takes care of the multiple spaces.

The attached simplified code assumes a fixed number of items (12), if this is a variable, you need to use a while loop and sense the end of the input string. Let me know if this is clear.
Message 3 of 3
(2,580 Views)