本帖最后由 apang 于 2014-12-12 23:34 编辑
- @echo off
- setlocal enabledelayedexpansion
-
- set "间隔行数=2"
-
- for /f "delims=" %%a in (2.txt) do (
- set /a LineA+=1
- set "_!LineA!=%%a"
- )
-
- (for /f "delims=" %%a in (1.txt) do (
- echo,%%a
- set /a "m=(LineB+=1)%%间隔行数, x+=^!m, y=(x-1)%%LineA+1"
- if "!m!" == "0" for %%b in (!y!) do echo,!_%%b!
- ))>new.txt
-
- pause
复制代码
|