本帖最后由 qixiaobin0715 于 2020-10-23 13:32 编辑
刚刚修改- @echo off
- chcp 65001 >nul
- set DB_NAME=test_%random%
- (for /f "skip=2 delims=" %%a in ('findstr /n .* dev.py') do (
- set "var=%%a"
- setlocal enabledelayedexpansion
- set line=!var:*]=!
- if "!line!" == "" (
- echo.
- ) else (
- set line=!line:*:=!
- if "!line!" == "" (
- echo.
- ) else (
- set line=!line:test_db=%DB_NAME%!
- echo !line!
- )
- )
- endlocal
- ))>dev.py.bak
- pause
复制代码
|