Read more than one tab on file

1

My code runs through all the cells in my worksheet and returns all the values I need, and in this file.xls has only one tab.

Now I have a new file to go through and there are 8 tabs. I know I need to boot with:

workbook_r = open_workbook('arquivo.xls', formatting_info=True)
worksheet_r = workbook_r.sheet_by_index(0)

Where in this second line I'm defining that the flip is traversed in position 0. How can I scroll through more than one tab in the whole file? It does not display an error, it just does not read the next tab. I have not found any reference in the xlrd library documentation to read more than one tab.

    
asked by anonymous 18.09.2014 / 15:00

1 answer

2

That way it works for me:

wb = open_workbook('arquivo.xls', formatting_info=True)
for ws in wb.sheets():
    print ws.name, ws.cell_value(1, 1)
    
19.09.2014 / 01:59