原帖由 more 于 2008-7-25 10:38 发表
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%a in ('type 11.txt') do (
set /a m+=1
set "home!m!=%%a"
)
for /f "delims=" %%b in ('type 12.txt') do (
set /a n+=1
set ...
代码可以简化,下面先公布我的第一种方法:- @echo off
- for /f "delims=" %%i in (1.txt) do set /a n+=1&call,set "_%%n%%=%%i"
- for /f "delims=" %%i in (2.txt) do set /a m+=1&call,set ".%%m%%=%%i"
- if %n% gtr %m% (set "num=%n%") else (set "num=%m%")
- for /l %%i in (1,1,%num%) do (
- if defined _%%i call,echo %%_%%i%%
- if defined .%%i call,echo %%.%%i%%
- )
- pause>nul
复制代码
[ 本帖最后由 batman 于 2008-7-25 17:05 编辑 ] |