复制代码 代码如下:
@echo off
:: 每6行拼接为一行,剩余的不够6行的显示在最后一行
::
::
set num=0
setlocal enabledelayedexpansion
for /f "delims=" %%i in (a.txt) do (
set /a num+=1
set str=!str! %%i
if !num! equ 6 echo !str! && set num=0 & set str=
)
if not "%str%"=="" echo %str%
pause
@echo off
:: 每6行拼接为一行,剩余的不够6行的显示在最后一行
::
::
set num=0
setlocal enabledelayedexpansion
for /f "delims=" %%i in (a.txt) do (
set /a num+=1
set str=!str! %%i
if !num! equ 6 echo !str! && set num=0 & set str=
)
if not "%str%"=="" echo %str%
pause