CrLf 当前离线
论坛巡查
@echo off findstr /n .* 1.txt>tmp1 find /n /v "" 2.txt|more>tmp2 +2 for /f "tokens=2*delims=]:" %%a in ('fc /lb1000 /n tmp1 tmp2^|sort') do echo;%%b del /q tmp? pause复制代码
TOP
qzwqzw (活着就是幸福)当前离线
贵宾
@echo off (for /f "delims=" %%a in (1.txt) do ( endlocal echo;%%a setlocal enabledelayedexpansion set /p t2= if defined t2 echo;!t2! ))<2.txt>合并.txt ::由于可以有两个不同的输入来源并存,所以双文本合并就成为轻而易举的事了复制代码
评分人数
尘丶 当前离线
四级士官
@echo off&setlocal enabledelayedexpansion (for /l %%a in (1,1,50) do set /p n%%a=)<1.txt (for /l %%a in (1,1,50) do set /p m%%a=)<2.txt for /l %%a in (1,1,50) do ( if not "!n%%a!"=="" echo;!n%%a! if not "!m%%a!"=="" echo;!m%%a! ) pause复制代码
ai20110304 当前离线
一级士官
@echo off & setlocal enabledelayedexpansion cd /d %~dp0 ::思路:通过行数定位结合more +n命令。 set /a nn=0 for /f "delims=" %%i in (1.txt) do ( echo;%%i call :lp !nn! & set /a "nn+=1" ) pause>nul & goto :eof :lp ::more 第一行是以0计数开始 for /f "delims=" %%x in ('more +%1 2.txt') do echo;%%x & goto :eof复制代码
qixiaobin0715 当前离线
大校
@echo off set /a m=1000,n=1001 setlocal enabledelayedexpansion for /f "delims=" %%a in (a.txt) do set /a m+=2&set #!m!=%%a for /f "delims=" %%b in (b.txt) do set /a n+=2&set #!n!=%%b for /f "tokens=2 delims==" %%c in ('set #') do echo %%c pause复制代码
netdzb 当前离线
上尉