@echo off
set "filename=test.txt"
cd.>tmp$
for /f "tokens=1* delims=:" %%a in ('findstr /n .* %filename%') do (
echo "%%b"|findstr "LASTF"|findstr "BENDE">nul&& (set n=%%a&goto :next)
echo.%%b >>tmp$
)
:next
more +%n% %filename% >>tmp$
move tmp$ %filename%