ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search Array of string

Hi , 

i have an array of string  that i want to extract how many times each element appear.

thank you.

 

0 Kudos
Message 1 of 4
(2,994 Views)

@Emna20 wrote:

Hi , 

i have an array of string  that i want to extract how many times each element appear.

thank you.


Is the element one character or a sequence?

 

If it's one element, convert to byte array, and use Equal? on a byte element. Then convert the Boolean array to 0-1, and add the elements.

 

If it's a longer string, use a match pattern, and put it in a while loop. Put the start index in a shift register. Stop looping if the result is -1. "i" is the number of elements found.

 

Message 2 of 4
(2,980 Views)

Take a look here for a similar question.

0 Kudos
Message 3 of 4
(2,954 Views)

@StevenD wrote:

Take a look here for a similar question.


With LabVIEW 2019, I would do a similar structure except using Maps.  You should see a little more performance and the structure is easier to understand.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,922 Views)