- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('type "文本.txt"') do (
- set "str=%%a"
- for /f "delims=" %%b in ("!str:~,5!") do (
- if not defined #%%b (
- set #%%b=!str:~5,5!
- ) else (
- if !str:~5^,5! geq !#%%b! set #%%b=!str:~5,5!
- )
- )
- )
- for /f "tokens=1,2 delims=#=" %%a in ('set #') do echo;%%a%%b
- pause
复制代码
|