本帖最后由 tmplinshi 于 2011-7-3 16:10 编辑
- @echo off
- setlocal
- set n=
- set f="1.bat"
-
- for /f "delims=* tokens=2" %%i in ('findstr /rc:" (.*\*.*\*.*) " %f%') do (
- if not defined _%%i (
- set str=%%i
- set /a n += 1
- setlocal enabledelayedexpansion
- echo [!n!] !str!
- for /f "tokens=1,2 delims=*" %%a in ("!n!*!str!") do (
- endlocal
- set _%%b=_
- set #%%a=%%b
- )
- )
- )
-
- :aki ============================================================
- set /p "str_key=删除哪个?:"
- setlocal enabledelayedexpansion
- findstr /vrc:" (.*\*!#%str_key%!\*.*) " !f! >..tmp
- endlocal
- move ..tmp %f%
-
- set "choice="&set/p choice=是否继续删除?(y/n):
- if /i "%choice%"=="y" goto:aki
- if /i "%choice%"=="n" exit
-
- endlocal
- pause
复制代码
|