回复 18# 封印
如此:- @echo off&setlocal enabledelayedexpansion
- (for /f "tokens=1* delims=:" %%a in (a.txt) do (
- set "str=%%b"
- set "str=!str::= !"
- for %%i in (!str!) do (
- for /f "delims=/" %%a in ("%%i") do (
- set "str=%%a"
- set "str=!str:.= !"
- set m=0
- set "tmp="
- for %%a in (!str!) do (
- set/a m+=1
- set ".=!tmp!"
- set "#!m!=%%a."
- set "tmp=%%a"
- )
- if "!.:~2!"=="" (set/a n=m-2) else set/a n=m-1
- set "e="
- for /l %%a in (!n!,1,!m!) do set "e=!e!!#%%a!"
- echo,!e:~,-1!
- )
- )
- ))>b.txt
复制代码
|