Spaces:
Sleeping
Sleeping
File size: 626 Bytes
66e3c31 8d9b435 66e3c31 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from openpyxl import load_workbook
import openpyxl as pyxl
def rowWise(dF,sN,nCl,nRw):
wb = load_workbook(filename = dF,data_only=True)
ws=wb[sN]
master=[]
for r in range(2,nCl+1):
for c in range(2,nRw+1):
wdta=[]
wdta.append(ws['A'+str(r)].value)
wdta.append(ws.cell(column=c, row=1).value)
wdta.append(ws.cell(column=c, row=r).value)
master.append(wdta)
ws = wb.create_sheet(title="RowData")
i=1
for rec in master:
for j in range(1,4):
ws.cell(column=j,row=i).value=rec[j-1]
i+=1
wb.save(filename = 'rwDta.xlsx')
return 'rwDta.xlsx' |