ワンクリックで
excel-debug-extraction
Iteratively debug Excel structure with exploratory scripts before writing extraction logic
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Iteratively debug Excel structure with exploratory scripts before writing extraction logic
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Delegate tasks to OpenSpace — a full-stack autonomous worker for coding, DevOps, web research, and desktop automation, backed by an extensive MCP tool and skill library. Skills auto-improve through use, reducing token consumption over time. A cloud community lets agents share and collectively evolve reusable skills.
Incremental audio production with duration mismatch handling, adaptive stem extension, and pre-mix alignment verification
Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow
Incremental audio production with duration alignment handling, per-stem verification, and adaptive extension strategies
Step-by-step audio production with per-stem verification, timing alignment, and incremental quality gates
End-to-end audio production workflow with stems, effects, archiving, and verification
| name | excel-debug-extraction |
| description | Iteratively debug Excel structure with exploratory scripts before writing extraction logic |
When working with poorly-structured, complex, or unfamiliar Excel files, use this iterative debugging approach to map the data layout before writing your final extraction logic.
Before writing extraction logic, create a debug script to explore the file structure:
# debug_structure.py
from openpyxl import load_workbook
wb = load_workbook('file.xlsx')
print(f"Sheets: {wb.sheetnames}")
for sheet_name in wb.sheetnames:
ws = wb[sheet_name]
print(f"\n=== Sheet: {sheet_name} ===")
print(f"Dimensions: {ws.dimensions}")
# Print first 10 rows to understand header structure
for row in ws.iter_rows(min_row=1, max_row=10, values_only=True):
print([str(cell)[:50] for cell in row])
Identify where key data fields are located:
# debug_columns.py
from openpyxl import load_workbook
wb = load_workbook('file.xlsx')
ws = wb['Sheet1']
# Examine header row to find column indices
header_row = 1
column_map = {}
for col in ws.iter_cols(min_row=header_row, max_row=header_row):
for cell in col:
if cell.value:
column_map[str(cell.value)] = cell.column_letter
print("Column mapping:", column_map)
# Sample data rows to verify structure
for row_num in range(2, min(6, ws.max_row + 1)):
row_data = [ws.cell(row=row_num, column=col).value
for col in range(1, ws.max_column + 1)]
print(f"Row {row_num}: {row_data}")
Understand how data rows are structured (e.g., summary rows, detail rows, blank separators):
# debug_rows.py
from openpyxl import load_workbook
wb = load_workbook('file.xlsx')
ws = wb['Sheet1']
row_types = []
for row_num in range(1, min(30, ws.max_row + 1)):
row_values = [ws.cell(row=row_num, column=col).value
for col in range(1, ws.max_column + 1)]
non_empty = sum(1 for v in row_values if v is not None and str(v).strip())
# Classify row type
if non_empty == 0:
row_type = "blank"
elif non_empty == 1:
row_type = "summary/label"
elif non_empty == ws.max_column:
row_type = "full_data"
else:
row_type = "partial"
row_types.append((row_num, row_type, row_values[:5]))
for rt in row_types:
print(f"Row {rt[0]} ({rt[1]}): {rt[2]}")
Before writing extraction logic, summarize:
Incorporate findings into your final processing script:
# extract_data.py
from openpyxl import load_workbook
import pandas as pd
wb = load_workbook('file.xlsx')
ws = wb['Sheet1']
# Use column mappings from debug phase
STORE_COL = 'B' # Column 2
WEEK1_COL = 'D' # Column 4
WEEK2_COL = 'E' # Column 5
# Skip header rows and summary rows based on debug findings
data_rows = []
for row_num in range(5, ws.max_row + 1): # Start after header based on debug
# Skip summary/blank rows
if ws.cell(row=row_num, column=2).value is None:
continue
if 'TOTAL' in str(ws.cell(row=row_num, column=2).value).upper():
continue
row_data = {
'store': ws.cell(row=row_num, column=2).value,
'week1': ws.cell(row=row_num, column=4).value,
'week2': ws.cell(row=row_num, column=5).value,
}
data_rows.append(row_data)
df = pd.DataFrame(data_rows)
print(df.head())
Use descriptive names for debug scripts:
debug_structure.py - Overall file/sheet structuredebug_columns.py - Column positions and headersdebug_rows.py - Row patterns and data boundariesdebug_values.py - Value patterns and edge casesKeep debug scripts alongside your extraction script for maintainability.