hello70 当前离线
二级士官
canyuexiaolang (vebjbr2wq)当前离线
荣誉版主
TOP
forfiles 当前离线
少将
apang 当前离线
上将
@echo off (for /f "tokens=1* delims=:" %%a in ('findstr /n ".*" a.txt') do ( set "str=%%b" setlocal enabledelayedexpansion if not "!str!"=="" ( set "str=!str:void 生成数组=void 生成数组11!" set "str=!str:生成数组、统计、显示可删除数=生成数组、统计、显示可删除数1!" set "str=!str:\\生成数组的.h=\\生成数组的1.h!" set "str=!str:\\=\1\!" ) echo,!str!&endlocal ))>b.txt复制代码
@echo off (for /f "tokens=1* delims=:" %%i in ('findstr /n .* a.txt') do ( set "line=%%j" setlocal enabledelayedexpansion if "!line!"=="" (echo.!line!) else ( set "line=!line:\\=\1\!" set "line=!line:显示可删除数=显示可删除数1!" set "line=!line:生成数组的.h=生成数组的11.h!" set "line=!line:void 生成数组=void 生成数组11!" echo.!line! endlocal )))>a_back.txt move a_back.txt a.txt pause复制代码
lunafay 当前离线
列兵
Get-Content D:\a.txt | %{$_.replace("void 生成数组","void 生成数组11")}| %{$_.replace("生成数组、统计、显示可删除数","生成数组、统计、显示可删除数1")}| %{$_.replace('\\','\1\')} | %{$_.replace('\\生成数组的.h','\\生成数组的11.h')}|out-file d:\b.txt复制代码
poter 当前离线
Topgunguy 当前离线
@echo off setlocal enabledelayedexpansion ::批处理似乎最多只收九个参数 for /l %%k in (1,1,9) do ( call echo transform %%%%k (for /f "tokens=1* delims=:" %%i in ('findstr /n .* %%%%k') do ( set "line=%%j" if "!line!"=="" (echo.!line!) else ( set "line=!line:/G05.1 Q1=!" set "line=!line:(G80=G80)!" set "line=!line:.M09=.!" set "line=!line:/G05.1 Q0=!" echo.!line! endlocal )))>back.txt move back.txt %%%%k call echo %%%%k DONE ) ) pause复制代码