Is there any way to read an XLS file and manipulate it in Python? Does any library allow this?
Is there any way to read an XLS file and manipulate it in Python? Does any library allow this?
import xlrd
def xlread(arq_xls):
"""
Gerador que le arquivo .xls
"""
# Abre o arquivo
xls = xlrd.open_workbook(arq_xls)
# Pega a primeira planilha do arquivo
plan = xls.sheets()[0]
# Para i de zero ao numero de linhas da planilha
for i in xrange(plan.nrows):
# Le os valores nas linhas da planilha
yield plan.row_values(i)
for linha in xlread('test.xls'):
print (linha)
pip install xlrd