I am trying to read xlsx do documents, find specific lane and print an area, but w/o printing None-lanes. Also break the cycle when "None" is in specific column.
def some():
for r in range(1, ws.max_row):
for c in range(1, ws.max_column):
db = ws.cell(row=r, column=c)
if db.value == 'this one':
for rows in ws.iter_rows(min_row=r + 1, min_col=c - 1,
max_row=r + 30, max_col=c):
for cell in rows:
if cell.value is None:
if column_index_from_string(db.column) == c:
return
else:
print(cell.value, end=" ")
print()
This code returns the only 1 lane and then break the head cycle.
Output:
1315 text.
Format of document: https://drive.google.com/file/d/0B_bbUxPgcVESVGstWWRxV3k4emM/view. I cant resolve this issue. Please excuse for native errors. I am new python and just looking for the answer.