I Am trying to find and print all the Phone numbers in this file. But the file got a lot of unreadable text. The file looks like this but then really big: e
How Can I decode this and find all the numbers? I now have the following code:
import glob
import re
path = "C:\\Users\\Joey\\Downloads\\db_sdcard\\mysql\\ibdata1"
files= glob.glob(path)
for name in files:
with open(name, 'r') as f:
for line in f:
print line
match = re.search(r'(/b/d{2}-/d{8}/b)', line)
if match:
found = match.group()
print found
When I run my script i get the following output:
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
Where do I have to put the .decode('utf8') And is my code for the rest good?