I have this .txt file where there is a special character which looks strange('uparrow', see screenshot). How do I remove this and blank lines along with unnecessary repeated header rows after few rows. My attempt -
remove_text = ['Trial Balance - Total Currency', 'Page:', 'Currency:', 'Balance Type:', 'ENTITY Range:', 'Ledger:', 'ENTITY:', '------------', '']
with open('MICnew.txt') as oldfile, open('MICnew.txt', 'w') as newfile:
for line in oldfile:
if not any(bad_word in line for bad_word in remove_text):
newfile.write(line)
with open('MICnew.txt','r+') as file:
for line in file:
if not line.isspace():
file.write(line)
My codes delete few unnecessary text and their lines but does not delete THE special char and blank lines