5i365 (我心飞扬)当前离线
上尉
foreach ($F in gci *.txt) { $C = Get-Content $F [IO.File]::WriteAllLines($F, $C); }复制代码
for_flr 当前离线
五级士官
TOP
idwma 当前离线
少校
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 }复制代码
评分人数
gci *.bat | foreach{ $text = [IO.File]::ReadAllBytes($_.FullName) if (($text.Count -gt 3) -and ($text[0] -eq '239') -and ($text[1] -eq '187') -and ($text[2] -eq '191')) { $s = $text[3 .. ($text.Count - 1)] [IO.File]::WriteAllBytes($_.FullName, $s); } }复制代码
Add-Type -Path "C:\chilkat\ChilkatDotNet48.dll"; $charset = New-Object Chilkat.Charset gci *.txt | foreach{ if ($charset.VerifyFile("bom-utf-8", $_.FullName)) { [IO.File]::WriteAllBytes($_.FullName, (gc -enc UTF8 $_.FullName)) } }复制代码