Zhanggli 当前离线
列兵
TOP
hfxiang 当前离线
上尉
sed -e"/T2/,/M05/{/M05/!d;s/M05/M05\nM55/;}" 1.txt>2.txt复制代码
qixiaobin0715 当前离线
大校
@echo off for /f "delims=" %%x in ('dir /b /a-d *.txt') do ( set n=0 (for /f "delims=" %%i in ('type "%%x"') do ( if "%%i"=="T2" set n= if defined n echo,%%i if "%%i"=="M05" ( set n=0 echo,%%i echo,M55 ) ))>"New-%%x" ) pause复制代码
77七 当前离线
中校
@echo off for /f "delims=" %%i in ('dir /b /a-d *.txt') do ( call :1 "%%i" ) pause & exit :1 setlocal for /f "tokens=1* delims=:" %%a in ('findstr /nxr /c:"M05" /c:"T2" "%~1"') do ( if not defined s ( set s=%%a ) else ( set e=%%a ) ) (for /f "tokens=1* delims=:" %%a in ('findstr /n .* "%~1"') do ( if %%a lss %s% ( echo=%%b ) else if %%a equ %e% ( echo=%%b echo=M55 ) else if %%a gtr %e% ( echo=%%b ) ))>$ move /y $ "%~1" endlocal exit /b复制代码
lovekix 当前离线
二级士官
@echo off set "str1=<Application Id="WindowsBackup" Executable="WindowsBackupClient.exe" EntryPoint="WindowsBackup.App" uap10[/]*[4]*:TrustLevel="mediumIL" uap10[/]*[4]*:RuntimeBehavior="windowsApp">" set "str2=</Application>" set "str1=%str1:"="""%" for /f "tokens=1 delims=:" %%a in ('findstr /nxr /c:"[ ]*%str1%" "appxmanifest.xml"') do set start=%%a for /f "tokens=1 delims=:" %%a in ('findstr /nxr /c:"[ ]*%str2%" "appxmanifest.xml"') do ( if %%a gtr %start% ( set end=%%a goto :next ) ) :next (for /f "tokens=1* delims=:" %%a in ('findstr /n .* "appxmanifest.xml"') do ( if %%a lss %start% echo=%%b if %%a gtr %end% echo=%%b ))>"appxmanifest-2.xml" pause复制代码
set "str1=<Application Id="WindowsBackup" Executable="WindowsBackupClient.exe" EntryPoint="WindowsBackup.App" uap10[/]*[4]*:TrustLevel="mediumIL" uap10[/]*[4]*:RuntimeBehavior="windowsApp">"复制代码
set "str1=<Application Id="WindowsBackup" Executable="WindowsBackupClient.exe" EntryPoint="WindowsBackup.App"*>"复制代码