本帖最后由 思想之翼 于 2019-10-22 22:17 编辑
- @echo off
- set file="list.txt"
- set per=1
-
- for %%a in (%file%) do set "dpn=%%~dpna" & set "x=%%~xa"
- set /a count=per-1, n=0
- setlocal enabledelayedexpansion
- for /f "usebackq delims=" %%a in (!file!) do (
- set /a count+=1, n=count/per
- echo %%a>>"!dpn!!n!!x!"
- )
复制代码 上述代码将list.txt分割成若干文本,名称为list1 list2...欲使分割文本名为list0001 list0002...如何修改上述代码? |