This commit is contained in:
David Rice
2026-05-05 15:02:49 +01:00
parent 82171742d2
commit 1ebd78f538
4 changed files with 181 additions and 105 deletions

28
inspect_seout.py Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python3
"""Quick diagnostic prints every sheet name, its headers, and 3 sample rows."""
from pathlib import Path
import openpyxl
path = Path("OCTO") / "seout.xlsx"
if not path.exists():
print(f"NOT FOUND: {path}")
raise SystemExit(1)
wb = openpyxl.load_workbook(path, data_only=True, read_only=True)
for sheet in wb.sheetnames:
ws = wb[sheet]
rows = list(ws.iter_rows(values_only=True))
print(f"\n=== Sheet: {sheet!r} ({len(rows)} rows) ===")
# Print first 15 rows so we can see past the metadata
for i, row in enumerate(rows[:15]):
vals = [v for v in row if v is not None]
if vals:
print(f" row {i+1}: {list(row)}")
# Also find any row that looks like a header (contains text with "part" or "mfg" or "price")
print("\n --- Searching for header row ---")
for i, row in enumerate(rows):
row_str = [str(v).lower() for v in row if v is not None]
if any("part" in v or "mfg" in v or "price" in v or "avg" in v for v in row_str):
print(f" row {i+1}: {list(row)}")
break
wb.close()