From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compare two string 2D arrays

Solved!
Go to solution

Hi,

 

I would like to get the indexes of the different elements between two string arrays. I can do it element by element but it seems stupid. Perhaps there is a simpler way that can do the job? Does anyone have ideas?

 

Thanks in advance.

 

Best Regards,

K

 

 

0 Kudos
Message 1 of 5
(2,906 Views)

Go row by row and compare the 1-D arrays.  If they are different then look for the Falses in that 1-D array.

0 Kudos
Message 2 of 5
(2,885 Views)
Solution
Accepted by topic author KwanSHL

Hi,

 

try this:

check.png

(Hint: Conditional and concatenating output tunnels…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(2,863 Views)

Thanks guys, this will do the trick!

0 Kudos
Message 4 of 5
(2,857 Views)

(The above assumes that the two arrays are identical in size and that equal entries need to be binary identical. Depending on where these strings come from, you might want to do a case insensitive match and/or ignore leading and trailing whitespace if present.)

0 Kudos
Message 5 of 5
(2,849 Views)