I have a text file with lines like:
str = '0|Crazy Taxi\xe2\x84\xa2 City Rush^Truck Racing Super Gear^Candy Crush Soda Saga^Car Parking^BMX Kid^Hill Climb Racing^UNLimited Kareena Kapoor^3D Car Parking^Find My Android Phone!^Christmas Trains^Top Free Games^Telegram^Door Screen Lock^Adventure of Ted 2 - Free^Sonic Jump^'
I want to to remove "\xe2\x84\xa2" which i am able to do using the following code line:
print unicode(str,errors="ignore")
output = '0|Crazy Taxi City Rush^Truck Racing Super Gear^Candy Crush Soda Saga^Car Parking^BMX Kid^Hill Climb Racing^UNLimited Kareena Kapoor^3D Car Parking^Find My Android Phone!^Christmas Trains^Top Free Games^Telegram^Door Screen Lock^Adventure of Ted 2 - Free^Sonic Jump^'
But when I am running the same logic on complete files using below mentioned code:
with open('train_data_dump.txt', mode='r') as document:
for line in document:
print unicode(line,errors='ignore')
It is printing the line as it was before.
Feel free to ask If I am not clear enough in asking question and please help.