Skip to content
FunCoding

z-md-excel

Extract all Markdown tables from a .md file and export to Excel (.xlsx). Use this skill when the user wants to: convert Markdown tables to Excel, extract tables from .md files, export MD table data to spreadsheet, batch convert multiple tables from one Markdown file. Supports multiple tables, GFM alignment markers, inline Markdown stripping. Each table becomes a separate sheet in the output Excel file.

Star
687
Last commit
Nov 22, 2026

z-md-excel/SKILL.md

View on GitHub

z-md-excel

Extract all Markdown tables from a .md file and save them to a formatted Excel .xlsx file.

When to Use

Trigger this skill when the user asks to:

  • Convert/extract Markdown tables to Excel
  • Export tables from a .md file to .xlsx
  • Batch extract multiple tables from one Markdown file
  • Parse Markdown table data into a spreadsheet

Requirements

  • Python 3.7+
  • openpyxl: pip install openpyxl

Usage

Command Line

# Basic usage (output defaults to <input_name>.xlsx)
python scripts/md2xlsx.py input.md

# Specify output file
python scripts/md2xlsx.py input.md output.xlsx
  1. Identify the Markdown file the user wants to extract tables from.
  2. Ensure openpyxl is installed: pip install openpyxl
  3. Run the script:
    python /path/to/z-md-excel/scripts/md2xlsx.py <input.md> [output.xlsx]
    
  4. Report results: The script prints the number of tables found and their dimensions.

Programmatic (inline Python)

import sys
sys.path.insert(0, '/path/to/z-md-excel/scripts')
from md2xlsx import extract_tables, write_xlsx

tables = extract_tables('input.md')
write_xlsx(tables, 'output.xlsx')

Output Format

  • Each table becomes a separate sheet named Table_1, Table_2, etc.
  • Header row: Bold white text on blue background, centered
  • Data rows: Regular font, auto-fitted column widths
  • Alignment: Preserved from Markdown GFM markers (:--- left, :---: center, ---: right)
  • Frozen pane: Top row frozen for easy scrolling
  • Inline Markdown stripped: Bold, italic, code, links, images are converted to plain text

How It Works

  1. Reads the Markdown file line by line
  2. Detects table blocks (consecutive lines containing |)
  3. Skips lines inside code blocks (``` fenced blocks)
  4. Requires a GFM separator row (|---|---|) to validate a table
  5. Strips inline Markdown formatting from cell content
  6. Writes all tables to a single Excel file

Limitations

  • Only supports GFM-style pipe tables (| col1 | col2 |)
  • Does not support HTML <table> elements
  • Does not preserve complex Markdown formatting (converts to plain text)
  • Nested tables are not supported

File Structure

z-md-excel/
├── SKILL.md          # This file (Agent instructions)
├── README.md         # Human-readable documentation
└── scripts/
    └── md2xlsx.py    # Core extraction script

Similar Skills

Featured

canvas-design

Create posters and visual art as PNG or PDF, guided by a design philosophy.

ANanthropics/skills203k3,265 new stars in the last 7 days

Featured

xlsx

Read and edit spreadsheets: add columns, compute formulas, format, and clean messy data.

ANanthropics/skills203k3,265 new stars in the last 7 days

Featured

docx

Create and edit Word docs with TOC, page numbers, headers and more.

ANanthropics/skills203k3,265 new stars in the last 7 days

Featured

pdf

Read and edit PDFs: extract text and tables, merge, split, rotate, and fill forms.

ANanthropics/skills203k3,265 new stars in the last 7 days

Featured

doc-coauthoring

Co-write specs, proposals and decision docs through a structured, iterative workflow.

ANanthropics/skills203k3,265 new stars in the last 7 days

Featured

pptx

Create and edit slide decks, generate slides from templates, and extract text.

ANanthropics/skills203k3,265 new stars in the last 7 days