@echo off
setlocal enabledelayedexpansion
set d=1
for /f "delims=" %%i in (test.txt) do (set /a a+=1)
set b=%a%
set /a b=%b%%%5
set /a a/=5
echo 平均 %a% 行一集,其中第 5 集多出 %b% 行。
for /f "delims=" %%i in (test.txt) do (
set /a c+=1
if !d! equ 5 set /a c+=!b!
>>!d!.txt echo %%i
if !c! equ !a! (
set /a d+=1
set c=0)
)
pause
Last edited by huzixuan on 2007-4-4 at 07:46 AM ]