Created
September 4, 2017 07:53
-
-
Save Kaundur/124e5179c16de7d7ef94de0ddaabd250 to your computer and use it in GitHub Desktop.
Simple read of an xlsx file using openpyxl
This file contains 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('data.xlsx') | |
sheets = workbook.get_sheet_names() | |
# Read first sheet | |
worksheet = workbook.get_sheet_by_name(sheets[0]) | |
for row in worksheet.iter_rows(): | |
for cell in row: | |
# Print out all values that belong to the cell object | |
print cell.coordinate, cell.column, cell.row, cell.value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment