- @echo off
- setlocal enabledelayedexpansion
- (for /f "tokens=1,2*" %%a in ('type "测试.txt"') do (
- set str=%%afedcba9876543210
- set/a len=0x!str:~15,1!
- if !len! geq 2 if !len! lss 4 if "%%c" == "" if not defined %%b (
- set %%b=def
- for /f "tokens=1,2*" %%i in ('find "%%b" "测试.txt"') do if "%%k" == "" (set "str=%%i %%j")
- echo,!str!
- )))>"结果.txt"
- pause
复制代码
|