- @echo off&SETLOCAL ENABLEDELAYEDEXPANSION
- for /f "tokens=1* delims=:" %%a in ('findstr /R "同学 电话" a.txt^|findstr /N ".*"') do set /a x=%%a%%2 & call :case!x! %%b >>new.txt
- pause&exit
-
- :case1 [同学]
- set name=%1%2%3%4
- for %%a in (同学 :) do set name=!name:%%a=!
- set /p=!name!=<nul
- exit /b 0
-
- :case0 [电话]
- set tel=%1%2%3%4
- for %%a in (电话 :) do set tel=!tel:%%a=!
- set /p=!tel!<nul
- echo;
- exit /b 0
复制代码
|