I created this topic ( Delete lines found in file with many lines ) and they suggested using the package "xlrd". I used and got interact with the file, but could not compare the contents of the cell with some string. Here's my code:
import xlrd
arquivo = xlrd.open_workbook('/media/IRREMOVIVEL/arquivo.xls',)
planilha = arquivo.sheet_by_index(0)
def lerPlanilha():
for i in range(planilha.ncols):
if (planilha.cell(8,9) == "2010"):
print 'it works =>'
break
else:
print 'not works'
break
lerPlanilha()
But I got error: not works
Sorry for duplicate, maybe, and bad english.