Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save haswello/f7fac5c4fbcd9d19a9f2bcb0a4ea6537 to your computer and use it in GitHub Desktop.

Select an option

Save haswello/f7fac5c4fbcd9d19a9f2bcb0a4ea6537 to your computer and use it in GitHub Desktop.
reading xlsx files in python with openpyxl
$ pip install -E ~/conf/virtualenvs/xyuml https://bitbucket.org/ericgazoni/openpyxl/get/1.5.8.zip
from openpyxl import load_workbook
workbook = load_workbook('/tmp/data.xlsx', use_iterators=True)
first_sheet = workbook.get_sheet_names()[0]
worksheet = workbook.get_sheet_by_name(first_sheet)
for row in worksheet.iter_rows():
print row
# check out the last row
for cell in row:
print cell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment