Perfunctory sampling reveals that your junk (looks like markup) may be that data which consistently (so far as I've checked) begins and ends with the sequence:
percent sign, digit, uppercase ALPHA
That might be the basis for using a regular expression to delete the markup.
Update: forgot to mention that this is not "code-a-matic;" your request that the Monks "provide me a universal solution for this" ignores the purpose of the Monastery; to help you learn, but NOT to do your $work/homework/coding for you.
If you didn't program your executable by toggling in binary, it wasn't really programming!