Bom trabalho:
@echo off &setlocal enabledelayedexpansion
(for /f %%a in (input.txt) do (
if "%%~a"=="WordA" (
if defined line echo(!line:~0,-1!
set "line="
)
(for /f "delims=0123456789" %%b in ("%%~a") do break) || set "line=!line!%%~a "
)
if defined line echo(!line:~0,-1!)>output.txt