I exported an Excel sheet in TXT format; upon reading it in Python, I am not able to find strings insde it.
I tried several methods, none works: each one works only if I look for one character long string! Why?!?
fname="elenco.txt"
counter=0
for line in open(fname):
counter = counter + 1
if counter>5:
break
if "AB" in line:
print "funziona"
print line
with open(fname, 'r') as inF:
for line in inF:
if 'T' in line:
print "OK"
with open(fname) as f:
content=f.readlines()
counter=0
for rec in content:
test=rec[:len(rec)-5]
print test, ">>>",test.find('TORINO')
counter = counter + 1
if counter>5:
break
#if rec.find("ABBIA")>0:
# print "Trovato: " + rec
print "Fine."