效率应当不算高,未经测试。- @echo off
- setlocal enabledelayedexpansion
- for %%a in (*.txt) do (
- for /f %%x in ('type "%%a"^|find /c /v ""') do set m1=%%x&set /a m2=m1-1
- set n=0
- (for /f "delims=" %%i in ('type "%%a"') do (
- set /a n+=1
- set str=%%i
- for %%y in (, 。 “ ” ? !) do set str=!str:%%y=!
- if not !n!==!m1! if not !n!==!m2! echo,%%i
- if !n!==!m1! if not "!str!"=="%%i" echo,%%i
- if !n!==!m2! if not "!str!"=="%%i" echo,%%i
- ))>#%%a
- )
- pause
复制代码
|