i'm new to Python, need Experts support to get output 1 & output 2 based on attached Input Can somebody help me to complete the below python code, need output 1 and Output 2 in separate sheets
https://i.stack.imgur.com/tZH9A.png][Input]
https://i.stack.imgur.com/zfZOG.png[Output1]
https://i.stack.imgur.com/cbAGx.png[Output2]
Thanks in advance
My current code:
import openpyxl
from openpyxl import Workbook
Path = "C:\Input.xlsx"
wb = openpyxl.load_workbook(Path)
sheet1 = wb["Sample"]
if os.path.exists("C:\Output.xlsx"):
os.remove("C:\Output.xlsx")
else:
print("The file does not exist")
newbook = Workbook()
newbook["Sheet"].title = "Output1"
newbook.create_sheet("Output2")
newbook.save("C:\Output.xlsx")
ShtOut1 = newbook["Output1"]
ShtOut2 = newbook["Output2"]
mr1 = sheet1.max_row
mc1 = sheet1.max_column
for k in range(1, mr1 + 1):
for l in range(2, 4):
d = sheet1.cell(row=k, column=l)
ShtOut1.cell(row=k, column=l-1).value = d.value
newbook.save("C:\Output.xlsx")