LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string with delimiter to 1 d array

Hello,

What I have is a string that is separated by comma delimiters and i would like the element that are separated by the commas to be put into a 1 d array. for example

string input = A0(7),A0(6),A0(5),A0(4),A0(3),A0(2),A0(1),A0(0),
so my output in a 1 d array looks like

A0(7)
A0(6)
A0(5)
A0(4)
A0(3)
A0(2)
A0(1)
A0(0)

I've been trying to do a search and use a shift register but can't seem to get it to work.  Thank you.  i attached a vi with the string and output array but left the logic out since i couldn't get it to work.
0 Kudos
Message 1 of 4
(2,806 Views)
There's a VI in the String functions palette that does this for you. It's called Spreadsheet String to array. You enter in your string, a string constant declaring your delimiter (tab, CRLF, etc), and a prototype for your output array (a 1D string array, for instance).
Jarrod S.
National Instruments
Message 2 of 4
(2,802 Views)
Thank you.
0 Kudos
Message 3 of 4
(2,798 Views)
Thank you.
0 Kudos
Message 4 of 4
(2,782 Views)