I'm reading a file in Python that isn't well formatted, values are separated by multiple spaces and some tabs too so the lists returned has a lot of empty items, how do I remove/avoid those?
This is my current code:
import re
f = open('myfile.txt','r')
for line in f.readlines():
if re.search(r'\bDeposit', line):
print line.split(' ')
f.close()
Thanks