Finised
This commit is contained in:
28
inspect_seout.py
Normal file
28
inspect_seout.py
Normal 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()
|
||||
Reference in New Issue
Block a user