Split the file.txt by any non-alphanumeric character, print each part with a space in between, and replace the beginning of each part with a #.
awk -F'[^a-zA-Z0-9_]*' '{printf "%s ",$0}' file.txt | xargs -I {} sed -i 's/^/#/' {}