本帖最后由 CrLf 于 2014-8-1 17:55 编辑
- @echo off&setlocal enabledelayedexpansion
- set "file=D:\test\记录.txt"
- %1 %0 :|sort /+65535 /o "!file!"&pause&exit
-
- for /f "delims=" %%a in ('sort /+65535 "!file!"') do (
- set "str=%%a"
- if "!str:通过=!" neq "!str!" (
- if !count! lss 3 set str=!str:通过=!
- set /a "count+=1"
- )
- echo !str!
- )
复制代码
|