LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find the number of duplicates in array

Hello,

 

In the attached VI, I am attempting to find the number of duplicates in a string array, then return a new array with the number and the corresponding number of times that string appears.  In the VI, for the given array:

100, 100, 100, 200, 200, 400, 400, 400, 400, 400, I would like to generate the array:

100 3

200 2

400 5

Thanks for your help!

0 Kudos
Message 1 of 4
(7,424 Views)
Message 2 of 4
(7,420 Views)

I would go with variant attributes. 😄

 

Here is an example you can adapt

Message 3 of 4
(7,402 Views)

Hi hiNI,

 

after being registered to this forum for more than 10 years you really should have heard of variant attributes:

check.png

Edit: Didn't notice Christians message #3 before composing my (quick&dirty) answer…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(7,390 Views)