- @echo off
- for /r %%a in (*.txt) do (
- set "fname=%%a"
- call :countLines
- )
- pause&&exit /b
-
- :countLines
- for /f "delims=[]" %%i in ('find /n /v ".*"^<"%fname%"') do (
- set count==%%i
- if !%%i! gtr 4 goto :dealFile
- )
- :dealFile
- if %count% equ 4 exit /b
- del /f /q "%fname%"
复制代码 涉及删除操作,请当心 |