cat with stdin EOF tag can be used to mix stdin input and file content
cat - << 'EOF' "file.txt"
text from stdin to prepend to file.txt content
EOF
would print to the stdout the line text from stdin to prepend to file.txt content
and after the content of file.txt
optionnaly, the output of the cat command can be redirected to a file with the line cat - << 'EOF' "file.txt" > out.txt
or event piped to another command with a similar line: cat - << 'EOF' "file.txt" | sed ...