回复 30# kokoxx
- @echo off
- rem 批处理保存为utf-8编码格式
- chcp 65001 >nul
- cd /d "%~dp0"
- set /a x=3,y=2
- for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- setlocal
- (for /f "tokens=1* delims=[]" %%a in ('find /n /v "" ^<"%%i"') do (
- if "%%b" equ "" (
- set /a n+=1
- ) else if defined n (
- set /a m=n/x*y+n%%x
- set n=
- setlocal enabledelayedexpansion
- for /l %%l in (1,1,!m!) do (
- echo=
- )
- endlocal
- echo=%%b
- ) else (
- echo=%%b
- )
- ))>$
- move $ "%%i"
- endlocal
- )
- pause
复制代码
|