If I remember correctly, the hidden characters are nothing more than CR/LF i.e. the last line is a blank line and not EOF immediately at the end of the last line of data.
i.e. in a text file just make sure you hit return at the end of the last line rather than saving without the <return> 'hidden' character(s).