Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Compare multidimensional arrays

$
0
0

I've got a problem with multidimensional arrays. I need to compare two multidimensional arrays as follows:

$array1
number      word

$array2
number      word

If "number" from $array1 matches any "number" in $array2, check if corresponding "word" from $array1 also matches "word" in $array2.
Also accept wildcards "*" for "word" in @array1, which should match any "word" in $array2.

Write out all non-matches to a third array, $array3.
The arrays are very different in size. $array1 will hold at most 50 entries. $array2 will probably contain hundreds or thousands.
I'm not very experienced with multidimensional arrays and can't figure out how to loop and match.

Bonus points to the one who figures out what I'm trying to achieve with this. :-)

Thanks in advance! 

  


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>