Compare multidimensional arrays
i've got problem multidimensional arrays. need compare 2 multidimensional arrays follows:
$array1
number word
$array2
number word
if "number" $array1 matches "number" in $array2, check if corresponding "word" $array1 matches "word" in $array2.
accept wildcards "*" for "word" in @array1, should match "word" in $array2.
write out non-matches third array, $array3.
arrays different in size. $array1 hold @ 50 entries. $array2 contain hundreds or thousands.
i'm not experienced multidimensional arrays , can't figure out how loop , match.
bonus points to 1 figures out what i'm trying achieve this. :-)
thanks in advance!
hint @ how need this.
$array1 | ?{$array2 -contains $_[0] }
i recommend against using arrays type of thing. use hash.
$hash=@{1='one';2='two',3='three' ...etc }
Comments
Post a Comment