方法一、
:- @echo off&set /a n=-1
- for /f "tokens=2-3 delims= " %%a in (a.txt) do call :loop "%%a" "%%b"
- pause
- :loop
- set /a n+=1
- if %n% equ 0 (set skip=) else (set skip=skip=%n%)
- for /f "%skip% tokens=3* delims= " %%i in (b.txt) do echo %~1,%~2,%%j&goto :eof
- goto :eof
复制代码 方法二、- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=2-3 delims= " %%a in (a.txt) do (
- set /a n+=1
- set .!n!=%%a,%%b
- )
- for /f "tokens=3* delims= " %%i in (b.txt) do (
- set /a m+=1
- call echo %%.!m!%%,%%j
- )
- pause
复制代码
|