先预处理1.txt
@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