-
-
Save haswello/f7fac5c4fbcd9d19a9f2bcb0a4ea6537 to your computer and use it in GitHub Desktop.
reading xlsx files in python with openpyxl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ pip install -E ~/conf/virtualenvs/xyuml https://bitbucket.org/ericgazoni/openpyxl/get/1.5.8.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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