import xlrd
book = xlrd.open_workbook("D:/Book.xlsx")
sh = book.sheet_by_name('Sheet4')
for rowidx in range(sh.nrows):
row = sh.row(rowidx)
for colidx, cell in enumerate(row):
if cell.value == "Issue":
print(sh.name)
print(colidx, rowidx)
data_colidx = colidx
data_rowidx = rowidx
first_row = []
i = int(data_rowidx)+1
concat_val = []
for x in range(sh.nrows):
first_row.append(sh.cell_value(i, data_colidx))
i = i + 1
if i >= sh.nrows:
break
if sh.cell(i, data_colidx).value == xlrd.empty_cell.value:
#print(i)
concat_val.append(sh.cell_value(i, 0) + '.' + sh.cell_value(i, 1))
Reading every row in the 'Issue' Column and if it is empty im concating the 'Dataset' and 'variable' column values.
What should do, if I need to concat both Dataset and Variable column and write in a new column.