search multiple 2d arrays and populate another

Brass Contributor

Hello, 

 

I need some help understanding how to loop through a number of arrays searching for a string (SEARCHTXT in the examples below), if found (SEARCHTXT_MATCHES) adding the data from the found index to another array. 

 

ArrayA to search 

myArrA   
 myArrA(1)  
  myArrA(1,1)TEXT
  myArrA(1,2)SEARCHTXT
  myArrA(1,3)INT
 myArrA(2)  
  myArrA(2,1)TEXT
  myArrA(2,2)SEARCHTXT_MATCHES
  myArrA(2,3)INT
 myArrA(3)  
  myArrA(3,1)TEXT
  myArrA(3,2)SEARCHTXT
  myArrA(3,3)INT

 

ArrayB to search (there could be many arrays)

myArrB   
 myArrB(1)  
  myArrB(1,1)TEXT
  myArrB(1,2)SEARCHTXT
  myArrB(1,3)INT
 myArrB(2)  
  myArrB(2,1)TEXT
  myArrB(2,2)SEARCHTXT_MATCHES
  myArrB(2,3)INT
 myArrB(3)  
  myArrB(3,1)TEXT
  myArrB(3,2)SEARCHTXT_MATCHES
  myArrB(3,3)INT

 

The resulting array built from the items above that had a matching string

myArrC   
 myArrC(1)  
  myArrA(2,1)TEXT
  myArrA(2,2)SEARCHTXT_MATCHES
  myArrA(2,3)INT
 myArrC(2)  
  myArrB(2,1)TEXT
  myArrB(2,2)SEARCHTXT_MATCHES
  myArrB(2,3)INT
 myArrC(3)  
  myArrB(3,1)TEXT
  myArrB(3,2)SEARCHTXT_MATCHES
  myArrB(3,3)INT

 

If anyone could help i would be most greatful

 

thanks

0 Replies