I wanted to know the best way to compare a master array with one column in it to multiple arrays<\/p>\n
The other arrays are comprised of 2 columns , the first column if found would have the input of the master array, if found, output the 2 colums in another array to later send it out into a csv.<\/p>\n
Here I have put 2 reference arrays (array1 and 2) but I could have more than 2, however only one masterarray.<\/p>\n
Quite new to Powershell so I’m not even how to start this…<\/p>\n
thanks<\/p>\n
$Masterarray\nexample1\nexample2\nexample3\nexample4\n\n$Array1 \nexample1 sample2\nexample5 sample3\nexample2 sample4\nexample6 sample5\n\n$array2 \nexample1 sample8\nexample7 sample4\nexample2 sample8\nexample4 sample6\n\n$OUT\nexample1 sample2\nexample1 sample8\nexample2 sample4\nexample2 sample8\nexample4 sample6\n<\/code><\/pre>","upvoteCount":5,"answerCount":7,"datePublished":"2022-04-28T19:30:38.000Z","author":{"@type":"Person","name":"bombcan","url":"https://community.spiceworks.com/u/bombcan"},"suggestedAnswer":[{"@type":"Answer","text":"I wanted to know the best way to compare a master array with one column in it to multiple arrays<\/p>\n
The other arrays are comprised of 2 columns , the first column if found would have the input of the master array, if found, output the 2 colums in another array to later send it out into a csv.<\/p>\n
Here I have put 2 reference arrays (array1 and 2) but I could have more than 2, however only one masterarray.<\/p>\n
Quite new to Powershell so I’m not even how to start this…<\/p>\n
thanks<\/p>\n
$Masterarray\nexample1\nexample2\nexample3\nexample4\n\n$Array1 \nexample1 sample2\nexample5 sample3\nexample2 sample4\nexample6 sample5\n\n$array2 \nexample1 sample8\nexample7 sample4\nexample2 sample8\nexample4 sample6\n\n$OUT\nexample1 sample2\nexample1 sample8\nexample2 sample4\nexample2 sample8\nexample4 sample6\n<\/code><\/pre>","upvoteCount":5,"datePublished":"2022-04-28T19:30:38.000Z","url":"https://community.spiceworks.com/t/having-to-get-differences-on-multiple-arrays/831579/1","author":{"@type":"Person","name":"bombcan","url":"https://community.spiceworks.com/u/bombcan"}},{"@type":"Answer","text":"What do you expect/want the output to be?<\/p>\n