回复 21# newswan
可以试试net静态类,这里只把读写改了就快了很多,如果把替换部分也改了应该还能再加速- Get-ChildItem -path $sour *.txt -Recurse | foreach-object {
- $_.fullname
- $b=( [IO.File]::ReadAllLines($_.fullname) ) -match "\w+\s+\w+\s+[-]?\w+" -notmatch $exclude -replace "SZ","1" -replace "SH","0" -replace "\s+","|"
- $a=$dest,$_.name -join '\'
- [IO.File]::WriteAllLines($a,$b)
- }
复制代码
|