I've created a program that takes data from a .txt files and uses a series of regular expressions to turn it into useful information that can go into a Pandas Dataframe. When I was testing this program, I was simply copying and pasting bits of the data from the .txt files into variables in Python, rather than uploading the entire .txt files. But now that I've finished all the testing, I can't figure out how to get the .txt files uploaded in a useful way.
I tried in both Google Colab and Jupyter Notebook. Here is the code for JN:
file1 = open("sample_file.txt","r")
file1.readlines()
Unfortunately, I get output that looks like gibberish (though might be hexadecimal).
'ÿþG\x00a\x00m\x00e\x00 \x00s\x00t\x00a\x00r\x00t\x00e\x00d\x00 \x00a\x00t\x00:\x00 \x002\x000\x001\x008\x00/\x007\x00/\x002\x001\x00 \x006\x00:\x003\x003\x00:\x001\x004\x00\n'
How do I fix this and make it readable so my program will run on it?