LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D array

Solved!
Go to solution

Hi

 

I need a help in 2d array. Actually  I have two 2D array with Input and Output..

I have to search element of Input and take index as refernce for output.

 

so result should be like this

 

INPUT      OUTPUT

aaa              ddd

bbb               eee

ccc                fff

thank you in advance

BR

Download All
0 Kudos
Message 1 of 2
(2,312 Views)
Solution
Accepted by topic author kalu

My first thought is "Why are you using 2D Arrays?"  And then "Why so many loops?"

 

All you need a 1 FOR loop, a Search 1D Array, an Index Array, and a comparison to stop your FOR loop if you found a match.  Autoindex on your Input and Output arrays.  You then search for String on the input array.  The Search 1D Array will output the index of the found item.  Just use that to index out the Output you want.  If a match was not found, -1 is the output.  So when you have an index that is greater or equal to 0, stop your FOR loop.  Output the result of the index array.


GCentral
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
Message 2 of 2
(2,307 Views)