本帖最后由 idwma 于 2022-2-21 20:33 编辑
回复 5# 5i365 - foreach ($F in gci *.txt)
- {
- $C=gc $F
- $b=(gc -enc byte $F)
- foreach($i in $b){
- if($i -gt 127 -and $i -ne 10 -and $i -ne 13){$d+=0.5}elseif($i -ne 10 -and $i -ne 13){$d++}
- }
- if((-join $C).length -eq $d){
- [IO.File]::WriteAllLines($F, $C);
- }
- rv d,i
- }
复制代码
|