SuperAPI AI Directory

xlsx-reader

Office & productivity

View repository

Updated 10-15 17:33

About this skill

Excel Reader

This skill reads Excel (.xlsx) files and converts them into Markdown table format.

Quick Start

Basic Usage

# WSL環境でPythonスクリプトを実行
wsl python3 scripts/read_xlsx.py "/mnt/c/path/to/file.xlsx"

Save in Markdown format

  1. Extract data with a script
  2. Save to a .md file with the Write tool

Prerequisites

The openpyxl package is required:

wsl pip3 install openpyxl

Usage Examples

Example 1: Read and display an Excel file

User: "data.xlsx を読み込んで"
Assistant:
1. Windowsパスを WSL パスに変換
2. wsl python3 scripts/read_xlsx.py を実行
3. 全シートの内容を Markdown テーブルで表示

Example 2: Read only a specific sheet

User: "data.xlsx の Sheet1 と Sheet2 だけ読み込んで"
Assistant:
1. スクリプトにシート名を指定して実行
2. 指定したシートのみ Markdown 化

Example 3: Read only part of a large file

User: "data.xlsx の最初の100行だけ読み込んで"
Assistant:
1. max_rows パラメータを指定して実行
2. 各シートの先頭100行のみ抽出

Workflow

Reading a single file

  1. The user specifies the Excel file path
  2. Convert the Windows path to WSL path format
  3. wsl python3 scripts/read_xlsx.py Run
  4. Display or save as a Markdown table

Processing multiple sheets

  1. Get all sheet names
  2. Convert each sheet to a table
  3. Organize with a heading for each sheet

Output format

Markdown structure

# data.xlsx

**Total Sheets:** 3

---

## Sheet: Sheet1

**Dimensions:** 100 rows × 5 columns

| 列1 | 列2 | 列3 | 列4 | 列5 |
| --- | --- | --- | --- | --- |
| データ1 | データ2 | データ3 | データ4 | データ5 |
| ... | ... | ... | ... | ... |

---

## Sheet: Sheet2

**Dimensions:** 50 rows × 3 columns

| A | B | C |
| --- | --- | --- |
| 値1 | 値2 | 値3 |
| ... | ... | ... |

---

Script details

The Python script is scripts/read_xlsx.py is located in.

Main features:

  • Reading multiple sheets
  • Conversion to Markdown table format
  • Sheet specification
  • Row count limit
  • Error Handling

How to use:

python scripts/read_xlsx.py <file_path> [sheet_names] [max_rows]

# 例
python scripts/read_xlsx.py data.xlsx
python scripts/read_xlsx.py data.xlsx 'Sheet1,Sheet2'
python scripts/read_xlsx.py data.xlsx 'Sheet1' 100

Supported features

  • ✅ Reading multiple sheets
  • ✅ Markdown table format
  • ✅ Sheet specification
  • ✅ Row count limit
  • ✅ Retrieving cell values (results of formulas)
  • ⚠️ Cell formatting information is lost
  • ⚠️ Images and charts cannot be extracted
  • ⚠️ Macros are not executed

Limitations

  • Cell formatting (colors, fonts, etc.) is lost
  • Images, charts, and shapes are not extracted
  • Macros are not executed
  • Only the evaluated values of formulas are retrieved
  • Be mindful of memory constraints with very large files

Troubleshooting

openpyxl is not installed

wsl pip3 install openpyxl

The file cannot be opened

  • Check whether the file is open in Excel
  • Check whether it is in .xlsx format (.xls is not supported)
  • Check the file access permissions
  • Check whether the file is corrupted

Out-of-memory error

For large Excel files:

# 行数を制限して読み込み
python scripts/read_xlsx.py large_file.xlsx '' 1000

Sheet not found

  • Check that the sheet name is exact (case-sensitive)
  • Watch out for spaces and special characters
  • Enclose the sheet name in quotes

Path conversion

Converting a Windows path to a WSL path:

  • C:\Users\... → /mnt/c/Users/...
  • D:\Projects\... → /mnt/d/Projects/...

Usage guide

File format Recommended skill Reason
.xlsx (Excel) xlsx-reader Excel native
.xls (old Excel) Via pandas Separate tool required
.csv Direct Read Text file
.tsv Direct Read Text file

Advanced usage

Reading only a specific sheet

# Sheet1 のみ
python scripts/read_xlsx.py data.xlsx 'Sheet1'

# 複数シート
python scripts/read_xlsx.py data.xlsx 'Sheet1,Sheet2,Sheet3'

Sampling large files

# 各シートの先頭100行のみ
python scripts/read_xlsx.py large_file.xlsx '' 100

Differences from CSV

Feature CSV Excel (.xlsx)
Multiple sheets ❌ ✅
Cell formatting ❌ ⚠️ (lost)
Formulas ❌ ✅ (values after evaluation)
File size Small Large
Read speed Fast Somewhat slow

Related tools

  • csv-reader: For CSV files (possible directly with the Read tool)
  • pandas: When more advanced data processing is required
  • xlrd: For legacy .xls files

Version history

  • v1.0.0 (2026-01-06): Initial release
    • Basic Excel reading functionality
    • Markdown table conversion
    • Multiple sheet support
    • Operation in WSL environment