I am student doing my master thesis. As part of my thesis, I am working with python. I am reading a log file of .csv format and writing the ext
.csv
with open('input.tsv','rb') as f: for ln in f: decoded=False line='' for cp in ('cp1252', 'cp850','utf-8','utf8'): try: line = ln.decode(cp) decoded=True break except UnicodeDecodeError: pass if decoded: # use 'line'