PowerShell 用法自查- $Char=@(); dir [12].txt |sort | %{
- ( GC $_ ) | % {
- if ( $_ -match '^NLLAG\s+(\d+)1\s+\d' ) { $Char += $matches[1] }
- if ( $_ -notmatch '^KNOTV\s+10\s+410|^BENDE|^$' ) {
- if ( $_ -like 'NLLAG*' ) { $_ } else {
- $_ -replace '230|500',"$($Char[1])0" -replace '50',"$($Char[0])0" }
- }
- } | sc $($_.BaseName + '-new.txt')
- }
- cmd /c pause
复制代码
|