I got a question, I've been searching high and low for this but cant find an answer (also my coding skills are zero to none).. In powershell I have 2 variables, for example say $apples and $oranges. They both contain a list of values that are not yet split and $oranges sometimes contains an empty value, like
$apples = red green blue yellow purple
$oranges = car bike chair shirt
They are in the correct order
Now what I'm trying to achieve is split the values inside the variables, but only print those values inside $apples that have a value greater than 2 characters in $oranges
So that it skips "blue" because in $oranges that spot is empty and the output in the text file would become something like this:
Apples red
Oranges car
Apples green
Oranges bike
Apples yellow
Oranges chair
Apples purple
Oranges shirt
Is there any mastermind out there that could help me?
only print those values inside $apples that have a value greater than 2 characters in $oranges