纯批,速度较慢
添加第一行数据- @echo off & cd /d "%~dp0"
- for /r %%i in (*.txt) do (
- echo %%i
- (
- echo "C:\Program Files\WinRAR\WinRAR.exe" a -d-ibck "cd1.rar"
- type "%%i"
- )>"%%i_NEW"
- move /y "%%i_NEW" "%%i" >nul 2>nul
- echo ----------------------
- )
- pause&exit
复制代码 每行首未尾添加数据- @echo off & cd /d "%~dp0"
- set "head=法规规范"
- set "foot=岁的法国但是"
- for /r %%i in (*.txt) do (
- echo %%i
- (
- for /f "tokens=1* delims=:" %%a in ('findstr /n .* "%%i"') do if "%%b"=="" ( echo. ) else ( echo %head%%%b%foot% )
- )>"%%i_NEW"
- move /y "%%i_NEW" "%%i" >nul 2>nul
- echo ----------------------
- )
- pause&exit
复制代码
|