NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member m-s
Member
m-s
Posts: 159
0 Kudos
Accepted Solution

Converting a delimited string to a string array

I have a string:

(no quotes)

 

"Aout,B,Cin,D,Etest".

 

I want to convert this into a 1D array of 

 

Aout

B

Cin

D

Etest

 

I could not find a VI that does that. Best way to do this ?

Trusted Enthusiast
TCPlomp
Posts: 3,097
0 Kudos

Re: Converting a delimited string to a string array

The string to array function will do that.

 

Use a comma as the delimimter and a 1d-array as the data-type.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Member m-s
Member
m-s
Posts: 159
0 Kudos

Re: Converting a delimited string to a string array

Thanks for the quick response.

 

I tried using the Spreadsheet string to array function, with the comma as the delimiter and %s as the format (as the documentation says). The input numeric double array (2D) is unwired. However, the output is still a double (orange) and wiring it to the search 1D array VI expecting a string array input produces a bad wire.

 

Am I using the wrong VI ?

Knight of NI
Dennis_Knutson
Posts: 34,412
0 Kudos

Re: Converting a delimited string to a string array

Simply wire an empty 1D string array to the 'array type input'.

Member m-s
Member
m-s
Posts: 159
0 Kudos

Re: Converting a delimited string to a string array

Had to wire a constant string array to the array type. Works now.

 

Thanks.

Knight of NI
RavensFan
Posts: 16,018
0 Kudos

Re: Converting a delimited string to a string array

Then please mark Dennis' message as the solution to your question instead of your own message since he was the one who gave you the solution.

 

You can unmark yours by going to the option menu to the upper right of your message.

Knight of NI
johnsold
Posts: 10,292
0 Kudos

Re: Converting a delimited string to a string array

Please start a new thread rather than appending to a three year old thread which is marked as Solved.

 

When you do so, please be more specific. Your brief statement does not tell us much about the string, how many segments to split, or anythng else. You did not actually ask a question.

 

Lynn

Trusted Enthusiast
billko
Posts: 2,322

Re: Converting a delimited string to a string array

[ Edited ]

You have to remember that this comes from a generation where they think that "That awkward feeling when you realize you can't write a complete sentence." is a complete sentence.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proven Zealot
crossrulz
Posts: 9,390
0 Kudos

Re: Converting a delimited string to a string array

9 posts all to old threads, no value added, weird link for JAVA help in the signature...screams SPAM to me.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Trusted Enthusiast
billko
Posts: 2,322
0 Kudos

Re: Converting a delimited string to a string array


crossrulz wrote:

9 posts all to old threads, no value added, weird link for JAVA help in the signature...screams SPAM to me.


I didn't see the little link at the bottom.  Shows how effective the SPAM was.  I'm surprised that there wasn't ten other old threads that resurfaced also...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.