- @echo off&setlocal enabledelayedexpansion
- set n=0
- for /f "delims=" %%i in (b.txt) do (set /a n+=1
- if !n! equ 3 (echo %%i>>输出文件.txt&&(for /f "delims=" %%a in (a.txt) do echo %%a )>>输出文件.txt) else echo %%i >>输出文件.txt
- )
- pause
复制代码 个人将你的1.txt保存为了a.txt
2.txt保存为了b.txt
有需要自已改一下吧 |