本帖最后由 batman 于 2012-12-29 01:35 编辑
- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in (a.txt) do (
- set "str=%%a"
- if "!str:~,1!" equ "*" (
- set "a=!str:~1,1!"
- if not defined _!a! (
- set "filename=!a!"&set /a _!a!=0
- ) else (
- set /a _!a!+=1
- for %%b in (!a!) do set "filename=!a! !_%%b!"
- )
- )
- echo %%a>>"!filename!.txt"
- )
复制代码
|