33,311
社区成员
发帖
与我相关
我的任务
分享
@echo off&setlocal EnableDelayedExpansion&if EXIST result_3.txt del result_3.txt
set a=0
set flag=0
:next
set b=1
set /a a=!a!+1
FOR /F "tokens=* " %%i in (1.txt) do (if !b! EQU !a! echo 1.txt的第%a%行%%i>>result_3.txt
set /a b=!b!+1
)
if !a! GTR !b! set flag=1
set b=1
FOR /F "tokens=* " %%i in (2.txt) do (if !b! EQU !a! echo 2.txt的第!a!行%%i>>result_3.txt
set /a b=!b!+1
)
if !a! LSS !b! goto next
if !flag! equ 1 goto end
goto next
:end