def parse_dof_file(file_path):
""" Parse dof rolling sales xls file"""
book = xlrd.open_workbook(file_path)
sheet = book.sheet_by_index(0)
rows = sheet.get_rows()
# remove first 4 row
[next(rows) for x in range(4)]
# 5th row is the headers
headers = to_headers(next(rows))
for row in rows:
_row = list(map(cell_converter, row))
if len(list(filter(item_exists, _row))):
yield dict(zip(headers, _row))
评论列表
文章目录