LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string and substring from an array of string

So just to make clear.

 

Input string can be something like : washington dallas seattle

 

Your items you want to search is in a list like : ington and shington

 

And you want to retrieve which search is found?

 

Kind regards 

 

Bjorn

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 11 of 24
(1,867 Views)

Hi,

 

if this is the case, then the attached file could be a solution.  If not, please try to explain what is wrong.

 

Kind regards,

 

Bjorn

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 12 of 24
(1,865 Views)

Forgot the -1 case

 

😉

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 13 of 24
(1,863 Views)

Thanks Bjorn, this is exactly what I wanted.

 

Agy.

0 Kudos
Message 14 of 24
(1,844 Views)

If you like the solution, think about kudo's 😉

Set this item to solved as well 😉

 

Have fun.  If you have any questions in the future, just let me know

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 15 of 24
(1,839 Views)

Hi Bjorn,

 

Looks like I have to get back to this. In your solution, looks like you are trying to match elements from the table to the elements from the incoming string. But instead I needed to ffind to match incoming strings with elements in the table.

The example obove from Jim is the right one but I need to output both the matching strings and all its substrings. and to make it nice, I would also output "not found" for elements for elements that are in my incoming strings but they are not in the table.

 

 for example if my incoming string is "washington, dallas, seattle, london" and my table has "shington, ington, las, seat, washington..." the output would be : shington, ington, washingtom, notfound, las, seat, notfound.

 

so the output are elements find in the table for each incoming string.

 

Your help will help.

 

Thank you

0 Kudos
Message 16 of 24
(1,806 Views)

Hi Agyna,

 

OK, let's try it with the next solution.  I've added an image in attachement as well if you don't know how to use a VI snippet.  As you can see in the image, it give you the output (array) : shington, ington, washington, las, seat, notfound.  If you want this in a string, you just have to use "array to spreadsheetstring".

 

If anything isn't clear, just send a message 

 

Kind regards,

 

Bjorn

 

StringInArray_Snippet.png

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 17 of 24
(1,796 Views)

No doubt you understand that the inputstring is still in codes display just to show you how to create an array from a string.  If you have any other other delimiter, just change the delimiter wired to the spreadsheetstring to array VI 

Smiley Wink

 

 

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 18 of 24
(1,795 Views)

 

 

Not working for me, any idea what is wrong here?

or can you send me the vi file your did. I am using labview 2010.

 

Thanks,

agyna

0 Kudos
Message 19 of 24
(1,780 Views)

Hi agyna,

the example is a snippet. You can drag it into LabVIEW to get the code. I think the mistake in your code is the conversion from string to string array. Is the string constant in "code display" mode? You need it the get the correct representation of "\s".

 

Hope it helps.

Mike

0 Kudos
Message 20 of 24
(1,752 Views)