|
本帖最后由 dos时代菜鸟 于 2022-5-21 22:26 编辑
这也是个思路
- @echo off
- setlocal ENABLEDELAYEDEXPANSION
- set file1=test.txt
- for /f "delims=" %%c in ('type !file1!') do (
- call :str_x "%%c"
- if !found0! EQU 1 ECHO [%%c]
- )
- pause
- goto :eof
- :str_x
- set "str1=%~1"
- SET found0=0
- set n=0
- :loop1
- for %%i in (!n!) do (
- set ch=!str1:~%%i,1!
- if "!ch!"=="" exit /b
- if not "!ch!"=="" (
- if "!ch!" GEQ "啊" ( if "!ch!" LEQ "齄" (
- set found0=1
- exit /b
- ))
- )
- )
- set /a n +=1
- goto loop1
- exit /b
复制代码
|
|