- @echo off&setlocal enabledelayedexpansion
- (for /f "delims=" %%a in ('dir /b /s *.txt') do (
- set No=%%~na
- set No1=!No:*.=!
- call set No=%%No:.!No1!=%%
- for /f "tokens=1,2* delims= " %%b in ('type "%%a"') do (
- if "%%b"=="1" echo %%c !No!
- )
- ))>$
- (echo No. affinity
- for /f "tokens=1-2 delims= " %%a in ('sort /r $') do echo %%b %%a
- )>result.txt&del $
- pause
复制代码
|