- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=1-4*" %%a in (a.txt) do (
- if defined str (
- set $1=%%b&set $2=%%c&set $3=%%d
- for /l %%I in (1,1,3) do (
- for /f "tokens=1* delims=." %%i in ("!$%%I!") do (
- set s=%%i
- if "!s:~,1!" == "-" (set b=-) else set b=
- set s=00000!s:-=!
- for /f "tokens=* delims=0" %%m in ("!s:~,-4!.!s:~-4!") do set $%%I=%%m%%j
- if "!$%%I:~,1!" == "." (set $%%I=!b!0!$%%I!) else set $%%I=!!b!!$%%I!
- )
- )
- set str=%%a !$1! !$2! !$3! %%e
- ) else set str=%%a %%b %%e %%d %%e
- echo !str!
- )
- pause
复制代码
|