I am reading in a text file that contains a specific format of numbers. I want to figure out if the first character of the line is a 6 or a 4 and store the entire line in an
Use:
$Fours = @() $Sixes = @() GC $file|%{ Switch($_){ {$_.StartsWith("4")}{$Fours+=$_} {$_.StartsWith("6")}{$Sixes+=$_} } }