本帖最后由 canyuexiaolang 于 2012-4-28 15:05 编辑
- @echo off
- for /f "tokens=* delims=" %%i in (1.txt) do set /a num+=1
- for /f "tokens=* delims=" %%i in (1.txt) do (
- set /a line+=1
- set "n=%%i"
- setlocal enabledelayedexpansion
- if !line! equ %num% (echo !n:AAA=BBB!>>1_temp.txt) else (echo %%i>>1_temp.txt)
- endlocal
- )
- move "1_temp.txt" "1.txt" && echo 完成
- pause>nul
复制代码
|