- @echo off&setlocal enabledelayedexpansion
- set /a a=b=c=d=e=100
- (for /f "delims=" %%i in (a.txt) do (
- set str=%%i&set t=!str:~,10!
- for /l %%j in (0 1 9) do set t=!t:%%j=!
- if "!t!" == "--" (echo;%%i) else (
- if "!t:~,1!" == "、" (
- set /a d+=1,e=100
- ) else if "!t:~,1!" == ")" (
- set /a "e+=1"
- ) else (
- for %%j in (一 二 三 四 五 六 七 八 九 十) do set t=!t:%%j=!
- if "!t:~,1!" == "、" (
- set /a "b+=1,c=d=e=100"
- ) else if "!t:~,2!" == "()" (
- set /a "c+=1,d=e=100"
- ) else set /a "a+=1,b=c=d=e=100"
- )
- echo !a:~-2!!b:~-2!!c:~-2!!d:~-2!!e:~-2!_%%i
- )
- ))>b.txt
- pause
复制代码
|