CrLf 当前离线
论坛巡查
@echo offfindstr /n .* 1.txt>tmp1find /n /v "" 2.txt|more>tmp2 +2for /f "tokens=2*delims=]:" %%a in ('fc /lb1000 /n tmp1 tmp2^|sort') do echo;%%bdel /q tmp?pauseCOPY
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::由于可以有两个不同的输入来源并存,所以双文本合并就成为轻而易举的事了COPY
评分人数
尘丶 当前离线
四级士官
@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.txtfor /l %%a in (1,1,50) do ( if not "!n%%a!"=="" echo;!n%%a! if not "!m%%a!"=="" echo;!m%%a!)pauseCOPY
ai20110304 当前离线
一级士官
@echo off & setlocal enabledelayedexpansioncd /d %~dp0::思路:通过行数定位结合more +n命令。set /a nn=0for /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 :eofCOPY
qixiaobin0715 当前离线
大校
@echo offset /a m=1000,n=1001setlocal enabledelayedexpansionfor /f "delims=" %%a in (a.txt) do set /a m+=2&set #!m!=%%afor /f "delims=" %%b in (b.txt) do set /a n+=2&set #!n!=%%bfor /f "tokens=2 delims==" %%c in ('set #') do echo %%cpauseCOPY
netdzb 当前离线
上尉