View Single Post
Old 12-12-2007   #3 (permalink)
Tao Ma


 
 

Re: More text processing.

Another way to solve this problem:

gc a.txt | % { "DSC`tRLI"; "------`t-----" } { if ($_ -match '^DSC') {
$out = [regex]::split($_, '\s+')[1];
}
elseif ($_ -match '^RLI' ) {
$out + "`t" + [regex]::split($_, '\s+')[1]
}
}


Best wishes!
Tao Ma



My System SpecsSystem Spec