I\'m trying to read a text file into python, but it seems to use some very strange encoding. I try the usual:
file = open(\'data.txt\',\'r\')
lines = file.
This piece of code will do the necessary
file_handle=open(file_name,'rb')
file_first_line=file_handle.readline()
file_handle.close()
print file_first_line
if '\x00' in file_first_line:
file_first_line=file_first_line.replace('\x00','')
print file_first_line
When you try to use 'file_first_line.split()' before replacing, the output would contain '\x00' i just tried replacing '\x00' with empty and it worked.