Find all files with the extension .txt in the entire file system, and for each of them, execute the command "sed -i 's/(.*)/echo \1 >> output.txt/'", which will take the contents of the file and append it to a file called output.txt.
find / -type f -name *.txt -exec sed -i 's/\(.*\)/echo \1 >> output.txt/' \;