powershell -c
"$text=[IO.File]::ReadAllText(‘文本.txt‘,[Text.Encoding]::Default);[regex]::Replace($text, ‘#‘, {param($m); ‘第‘+(++$n)+‘个‘})"
>
"结果.txt"
pause
批处理替换递增数字
原文:http://www.cnblogs.com/aitiangua/p/7867737.html