33 lines
1022 B
Python
33 lines
1022 B
Python
import openpyxl
|
|
import sys
|
|
# Force stdout to utf-8 if possible, or just replace bad chars on print
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
|
|
|
from wif2ansible.excel_reader import clean_header
|
|
|
|
def debug(filename):
|
|
wb = openpyxl.load_workbook(filename, data_only=True)
|
|
for sname in wb.sheetnames:
|
|
if 'application' not in sname.lower():
|
|
continue
|
|
print(f"--- Sheet: {sname} ---")
|
|
sheet = wb[sname]
|
|
for r in range(1, 30):
|
|
if sheet.row_dimensions[r].hidden:
|
|
print(f"Row {r}: [HIDDEN]")
|
|
continue
|
|
|
|
vals = []
|
|
for c in range(1, 20): # Scan first 20 cols
|
|
v = sheet.cell(row=r, column=c).value
|
|
if v:
|
|
try:
|
|
vals.append(clean_header(v))
|
|
except:
|
|
vals.append("ERROR")
|
|
if vals:
|
|
print(f"Row {r}: {vals}")
|
|
|
|
if __name__ == "__main__":
|
|
debug(sys.argv[1])
|