本帖最后由 apang 于 2013-1-11 20:16 编辑
- @echo off
- set /a n=5,m=6
- set "v=批处理之家"
- for %%a in (*.txt) do (
- (for /f "usebackq delims=" %%b in ("%%a") do (
- set /a Lin+=1
- set "str=%%b"
- setlocal enabledelayedexpansion
- if !Lin! gtr %m% (echo,!str!
- ) else echo,!str:~,%n%!%v%!str:~%n%!
- endlocal
- ))>$
- move $ "%%a"&set "Lin="
- )
- pause
复制代码
|