本帖最后由 77七 于 2022-11-13 11:42 编辑
- @echo off
- For /F %%a In (1.txt) Do (
- Echo %%a| FindStr 123 && ( set "h=%%a" ) || ( set "k=%%a" )
- )
- rem h为包含 k为不包含
- pause
复制代码 自己加一个不就行了...- @echo off
- setlocal enabledelayedexpansion
- For /F %%a In (1.txt) Do (
- Echo %%a| FindStr 123 && ( set "h=%%a" & call :al ) || ( set "k=%%a" & call :a2 )
- )
-
- pause
-
- :al
- echo al方法正在处理含123:!h!
- exit /b
-
- :a2
- echo a2方法正在处理不含123:!k!
- exit /b
复制代码
|