powershell- $p = '姓名','单位名称'
- $path = "$PWD\*.txt"
- $Exclude ="$PWD\整合.txt"
- ((select-string -Path $path -Exclude $Exclude -pattern $p -Encoding default -SimpleMatch -context 0,1|% {$_.line + ':' + $_.context.postcontext})) -join ' '| Out-File '整合.txt'
复制代码
|