Created
July 6, 2016 00:50
-
-
Save mfcovington/5306b736d33fd5db62377dcf417d953e to your computer and use it in GitHub Desktop.
Parse Excel Submission Form
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 | |
wb = load_workbook(filename = 'SubmissionForm.xlsx') | |
sheet = wb.get_sheet_by_name(wb.sheetnames[0]) | |
header_row = sheet.rows[0] | |
for row in sheet.rows[1:]: | |
# Ignore empty rows | |
if row[0].value is None: | |
continue | |
for header, cell in zip(header_row, row): | |
if header.value is None: | |
continue | |
print('{}\n\t{}'.format(header.value, cell.value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: