clean-data-xls
Clean up messy spreadsheet data — trim whitespace, fix inconsistent casing, convert numbers-stored-as-text, standardize dates, remove duplicates, and flag mixed-type columns. Use when data is messy, inconsistent, or needs prep before analysis. Triggers on "clean this data", "clean up this sheet", "normalize this data", "fix formatting", "dedupe", "standardize this column", "this data is messy".
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o clean-data-xls.zip https://jpskill.com/download/22547.zip && unzip -o clean-data-xls.zip && rm clean-data-xls.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22547.zip -OutFile "$d\clean-data-xls.zip"; Expand-Archive "$d\clean-data-xls.zip" -DestinationPath $d -Force; ri "$d\clean-data-xls.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
clean-data-xls.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
clean-data-xlsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
データのクリーンアップ
アクティブシートまたは指定された範囲内の乱雑なデータをクリーンアップします。
環境
- Excel 内で実行する場合 (Office アドイン / Office JS): Office JS を直接使用します (
Excel.run(async (context) => {...}))。range.valuesを介して読み取り、range.formulas = [["=TRIM(A2)"]]を介してヘルパー列の数式を書き込みます。インプレースかヘルパー列かの決定は引き続き適用されます。 - スタンドアロンの .xlsx ファイルを操作する場合: Python/openpyxl を使用します。
ワークフロー
ステップ 1: 範囲設定
- 範囲が指定されている場合 (例:
A1:F200) は、それを使用します。 - それ以外の場合は、アクティブシートの全使用範囲を使用します。
- 各列をプロファイリングします。その主要な型 (テキスト / 数値 / 日付) を検出し、外れ値を特定します。
ステップ 2: 問題の検出
| 問題 | 探すべきもの |
|---|---|
| 空白 | 先頭/末尾のスペース、二重スペース |
| 大文字/小文字 | カテゴリ列での一貫性のない大文字/小文字 (usa / USA / Usa) |
| テキストとしての数値 | テキストとして保存されている数値。数値セル内の余分な $, ,, % |
| 日付 | 同じ列内の混在する形式 (3/8/26, 2026-03-08, March 8 2026) |
| 重複 | 完全一致の重複行とほぼ重複する行 (大文字/小文字、空白の違い) |
| 空白 | 他のデータが入力されている列内の空のセル |
| 混在する型 | 98% が数値だが、3つのテキストエントリがある列 |
| エンコーディング | 文字化け (é, ’)、非表示文字 |
| エラー | #REF!, #N/A, #VALUE!, #DIV/0! |
ステップ 3: 修正案の提示
変更を加える前に、概要テーブルを表示します。
| 列 | 問題 | カウント | 提案された修正 |
|---|
ステップ 4: 適用
- ハードコードされたクリーンアップ値よりも数式を優先します — クリーンアップされた出力が数式として表現できる場合 (例:
=TRIM(A2),=VALUE(SUBSTITUTE(B2,"$","")),=UPPER(C2),=DATEVALUE(D2)) は、Python で結果を計算して元の値を上書きするのではなく、隣接するヘルパー列に数式を書き込みます。これにより、変換が透過的で監査可能になります。 - ユーザーが明示的に要求した場合、または適切な数式に相当するものがない場合 (例: エンコーディング/文字化けの修復) にのみ、計算された値でインプレース上書きします。
- 破壊的な操作 (重複の削除、空白の埋め、元の値の上書き) の場合は、まずユーザーに確認します。
- 各修正カテゴリ (空白 → 大文字/小文字 → 数値変換 → 日付 → 重複排除) の後、変更内容のサンプルをユーザーに表示し、次のカテゴリに進む前に確認を得ます。
- 変更内容のビフォー/アフターの概要を報告します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Clean Data
Clean messy data in the active sheet or a specified range.
Environment
- If running inside Excel (Office Add-in / Office JS): Use Office JS directly (
Excel.run(async (context) => {...})). Read viarange.values, write helper-column formulas viarange.formulas = [["=TRIM(A2)"]]. The in-place vs helper-column decision still applies. - If operating on a standalone .xlsx file: Use Python/openpyxl.
Workflow
Step 1: Scope
- If a range is given (e.g.
A1:F200), use it - Otherwise use the full used range of the active sheet
- Profile each column: detect its dominant type (text / number / date) and identify outliers
Step 2: Detect issues
| Issue | What to look for |
|---|---|
| Whitespace | leading/trailing spaces, double spaces |
| Casing | inconsistent casing in categorical columns (usa / USA / Usa) |
| Number-as-text | numeric values stored as text; stray $, ,, % in number cells |
| Dates | mixed formats in the same column (3/8/26, 2026-03-08, March 8 2026) |
| Duplicates | exact-duplicate rows and near-duplicates (case/whitespace differences) |
| Blanks | empty cells in otherwise-populated columns |
| Mixed types | a column that's 98% numbers but has 3 text entries |
| Encoding | mojibake (é, ’), non-printing characters |
| Errors | #REF!, #N/A, #VALUE!, #DIV/0! |
Step 3: Propose fixes
Show a summary table before changing anything:
| Column | Issue | Count | Proposed Fix |
|---|
Step 4: Apply
- Prefer formulas over hardcoded cleaned values — where the cleaned output can be expressed as a formula (e.g.
=TRIM(A2),=VALUE(SUBSTITUTE(B2,"$","")),=UPPER(C2),=DATEVALUE(D2)), write the formula in an adjacent helper column rather than computing the result in Python and overwriting the original. This keeps the transformation transparent and auditable. - Only overwrite in place with computed values when the user explicitly asks for it, or when no sensible formula equivalent exists (e.g. encoding/mojibake repair)
- For destructive operations (removing duplicates, filling blanks, overwriting originals), confirm with the user first
- After each category of fix (whitespace → casing → number conversion → dates → dedup), show the user a sample of what changed and get confirmation before moving to the next category
- Report a before/after summary of what changed