The Batch file below was written precisely to solve this problem as it is stated, so it will not solve any other similar problem.
@echo off
setlocal EnableDelayedExpansion
set "Source = B"
for /F "delims=" %%a in (input.txt) do (
set "line=%%a"
if "!line:~0,1!" equ "[" (
if "!Source !" neq " B" (
echo !label!
for %%v in (Answer Source Value) do echo %%v =!%%v !
echo/
)
set "label=%%a"
) else (
set "%%a"
)
)
if "!Source !" neq " B" (
echo !label!
for %%v in (Answer Source Value) do echo %%v =!%%v !
echo/
)