Answer the question
In order to leave comments, you need to log in
How to add a character to an existing string in openpyxl?
Let's say I already have an excel file with a table. How to add a character to each cell table.
In my case, I need a space.
There is such a sketch of the code, but it is not working.
wb = openpyxl.reader.excel.load_workbook(filename="schedule.xlsx", data_only=True)
wb.active = 1
sheet = wb.active
for row in range(11, 47):
for col in range(4, 6):
a = srt(sheet[str(row)+ str(col)].value) +str(" ")
cell = sheet.cell(row = row, column = col)
cell.value = str(a)
wb.save('example.xlsx')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question