每 3 个句号换一次行- PowerShell -c "dir *.txt | ForEach{$arr=(type $_) -replace '(?:[^。]*。){3}(?!$)', ('$&'+\"`r`n\"); sc ($_.Name + '.Log') -value $arr}"
复制代码 在句号之前换行:- PowerShell -c "dir *.txt | ForEach{$arr=(type $_) -replace '((?:[^。]*。){2}[^。]*)。(?!$)', ('$1'+\"`r`n。\"); sc ($_.Name + '.Log') -v $arr}"
复制代码
|