LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to display duplicate strings in 1d string array

Solved!
Go to solution

I have some strings in 1d array string and I need to display the duplciate strings present in the 1d string array...pls let me know..I am using labview 2010 ver

0 Kudos
Message 1 of 8
(4,166 Views)

I would display them in an 1D array of strings indicator on the front panel. 

 

If you are also interested on how to find the duplicate strings, do a forum search for e.g. removing duplicate elements, then adapt the code. Should be quite simple. There are plenty of wys to do that and some ways scale much better if the array are large. What have you tried so far? Is this for school?

0 Kudos
Message 2 of 8
(4,157 Views)

I tried but i am not able to display

0 Kudos
Message 3 of 8
(4,149 Views)

@Mandya wrote:

I tried but i am not able to display


Just wire the array of duplicate elements to an indicator terminal. Show us what you tried so far and we can give you tips how to fix it.

0 Kudos
Message 4 of 8
(4,144 Views)

I have attached the VI

0 Kudos
Message 5 of 8
(4,135 Views)
Solution
Accepted by topic author Mandya

@Mandya wrote:

I have attached the VI


Well, there are several possible solution. Do you want all elelemts that are not in the current output or do you only want one each. For example if the array contains 3 of the same element, do you want it twice in the duplicate output?

 

I assume you only want it once, so simply scale the existing code accordingly. See attached example. If you want all, remove the inner case and search node and blindly append all duplicate elements.

 

Note that there are singificantly more efficient ways to do all this, but the current code is sufficient for small arrays.

Message 6 of 8
(4,125 Views)

thanks for your solution

0 Kudos
Message 7 of 8
(4,107 Views)

How would you return the number of times the string was repeated? 

0 Kudos
Message 8 of 8
(3,912 Views)