1: 2: 3: 4: 5: 6:
$i = 1 switch -regex -file "c:\temp\extract.txt" { "^isa\s" {if($fileString){$filestring | out-file "File$i.txt"};$fileString = $_;$i++} "^(?!isa)" {$fileString += "`r`n$_"} }