Ich verwende Python. Hier ist die Ausgabe: < /p>
Code: Select all
Approval Memo of : SHILPI AKTER
Name of the Applicant : SHILPI AKTER
Name of Territory : Comilla
Total Family Expenses : 30000
Ref : N/A
Amount : N/A
Total Amount : 3000
< /code>
Ref und Betrag < /strong> Eigenschaften Wert nicht gefunden.
Hier ist mein Code: < /p>
import os
import openpyxl
from openpyxl.utils import column_index_from_string
file_path = r"D:\file\input\example.xlsx"
if os.path.exists(file_path):
print("File exists!")
else:
print("File not found! Check the path.")
exit()
target_sheet = "Output Approval Templete"
# Define the properties to extract
properties = [
"Approval Memo of",
"Name of the Applicant",
"Name of Territory",
"Total Family Expenses",
"Ref",
"Amount",
"Total Amount"
]
# Function to get the actual value from a merged cell
def get_merged_cell_value(sheet, row, col):
for merged_range in sheet.merged_cells.ranges:
min_row, min_col, max_row, max_col = merged_range.bounds # Extract merged cell bounds
if min_row