- @echo off&SetLocal EnableDelayEdexpansion&cd /d "%~dp0"
- set "num=10"
- set "file=0"
- for /f "delims=" %%a in (11.txt) do (
- set /a n+=1
- if not defined flag (
- set "str=!str! %%a"
- if "!n!" == "!num!" set /a file+=1&(echo !str!)>"F_!file!.txt"&set "str="&set "n=0"&set "flag=1"
- ) else (
- set "str=%%a !str!"
- if "!n!" == "!num!" set /a file+=1&(echo !str!)>"F_!file!.txt"&set "str="&set "n=0"&set "flag="
- )
- )
- pause
复制代码
|