批处理bat如何将a文本每行的内容复制到b文本中,且行数一一对应
如a文本内容:
1
2
3
4
b文本内容:
a
b
c
d
我想要达到的结果
1a
2b
3c
4d
求各位解惑
@echo off
rem
echo a.txt:
type a.txt
echo.
echo b.txt:
type b.txt
echo.
echo.
rem 上面rem之间内容可以删除
setlocal EnableDelayedExpansion
set IN=0
FOR /F %%i in (a.txt) do (
set T=0
FOR /F %%j in (b.txt) do (
if "!T!" == "!IN!" (
echo %%i%%j
echo %%i%%j >> c.txt
)
set /A T+=1
)
set /A IN+=1
)