- @echo off & setlocal enabledelayedexpansion
- for /f "delims=" %%i in (1.txt) do (
- set "s=%%i"
- if !n! LSS 1 (
- if "!s:BENDE=!" NEQ "!s!" (
- if "!s:LASTF=!" NEQ "!s!" (set /a n+=1) else (echo;!s!)
- ) else (echo;!s!)
- ) else (echo;!s!)
- )
- pause
复制代码
- sed -r "0,/BENDE.*LASTF|LASTF.*BENDE/{//d}" 1.txt
复制代码
- PowerShell "(type 1.txt) -join \"`r`n\" -replace '^([\s\S]*?).*(?:BENDE.*LASTF|LASTF.*BENDE).*(?:\n|$)', '$1'"
复制代码
|