先用:- for /f "delims=" %%i in ('type b.txt') do >>b-.txt echo %%i
复制代码 把b.txt处理了
或者把4楼的改成:- @echo off & setlocal enabledelayedexpansion
- for /f "tokens=1* delims=:" %%a in ('findstr /n .* a.txt') do set a%%a=%%b&set x1=%%a
- for /f "tokens=1* delims=:" %%a in ('type b.txt^|findstr /n .*') do set b%%a=%%b&set x2=%%a
- set /a x=!x1!*!x2!,xx1=1,xx2=1
- for /l %%a in (1 1 !x!) do (
- call :xx
- set/a xx1+=1,xx2+=1
- if !xx1! gtr !x1! set xx1=1
- if !xx2! gtr !x2! set xx2=1
- )
- pause
- :xx
- call echo.%%a%xx1%%%%%b%xx2%%%
复制代码 如果不强调顺序,可以直接:- @echo off
- for /f "delims=" %%a in (a.txt) do for /f "delims=" %%b in ('type b.txt') do echo.%%a%%b
- pause
复制代码
[ 本帖最后由 hanyeguxing 于 2010-4-24 14:09 编辑 ] |