Find all directories (type d) in the current directory (~) and its subdirectories, then find all files ending with .txt, then use xargs to pass the file names to the cat command to print the contents of the files, then use sed to print only the lines containing 4 digits.
find ~ -type d \( -name '*.txt' \) | xargs cat | sed -n '/[0-9]\{4\}/p'