I’m attempting to write either a data table or a logged file, which is then attached to an email. The data is being incorrectly overwritten with this strange text.
Code:


Both result in this:

Can anyone provide some guidance on the issue or resolution here?