@echo off
set count=1
for /f "tokens=*" %%i in (1.txt) do call :slz %%i
:slz
<nul set/p=%1 >>ok.txt
if %count% equ 2 echo.>>ok.txt&set count=0
set /a "count=%count%+1"
goto:eof
@echo off
set num=0
setlocal enabledelayedexpansion
for /f "delims=" %%i in (1.txt) do (
set /a num+=1
set str=!str! %%i
if !num! equ 2 echo !str! && set num=0 & set str=
)
if not "%str%"=="" echo %str% %str%
pause
Originally posted by fastslz at 2007-11-13 11:57 PM:
@echo off
set count=1
for /f "tokens=*" %%i in (1.txt) do call :slz %%i
:slz
<nul set/p=%1 >>ok.txt
if %count% equ 2 echo.>>ok.txt&set count=0
set /a " ...
@echo off
for /f "tokens=1* delims=:" %%i in ('findstr /n .* 1.txt') do (set /a rowcount=%%i%%2)&(set endrow=%%j)
if %rowcount% neq 0 echo %endrow%>>1.txt
for /f "tokens=1* delims=:" %%i in ('findstr /n .* 1.txt') do call :slz %%i %%j
pause
:slz
set xx=%1
if not defined xx goto:eof
set /a row=%1%%2
if %row% equ 1 (set newrow=%2) else (echo %newrow% %2>>ok.txt)
goto:eof