回复 20# PCL0769
数据量很大,powershell 效率高些- $sour = "D:\share\tech\New folder (2)\aaa"
- $dest = "D:\share\tech\New folder (2)\ccc"
- $exclude = "20210227"
-
- Remove-Item $dest\*.txt
-
- get-date
-
- Get-ChildItem -path $sour *.txt -Recurse | foreach-object {
- $_.fullname
- ( get-content $_.fullname ) -match "\w+\s+\w+\s+[-]?\w+" -notmatch $exclude -replace "SZ","1" -replace "SH","0" -replace "\s+","|" | out-file -append $dest\$_
- }
-
- get-date
-
- Get-ChildItem -path $dest *.txt | foreach-object {
- $_.fullname
- $a = get-content $_.fullname | sort-object -unique
- $a | out-file $dest\$_
- }
-
- get-date
复制代码
|