I have a bunch of XML files that have been corrupted. Within them is still some uncorrupted data. Here is a picture of what I am talking about:
I want to iterate through each of the files with python and grab the un-corrupted data, but when I open the file with python:
i2 = open(x + '/' + i, 'r')
It opens the file, but when I try to read through it, it comes back to me saying that only this was read from the file:
'\xa8\x9f\xb0\xdb\x17\xa1\t&}4U\xccsr\xcfN\x7fS\xa1C\xb5\xa4\xd6a\x84i'
I've tried a few different encodings, but it keeps coming back with an error:
i2 = open(x + '/' + i, 'r', encoding='utf8')
i2 = open(x + '/' + i, 'r', encoding='ANSI')
Please let me know if you know why Python is not reading this file correctly.