csv-cleaner
Clean and normalize messy CSV/TSV files - fix malformed rows, inconsistent headers, mixed encodings, stray delimiters, and duplicated records - and deliver a…
от Krusty84★ 36 звёзд на GitHub
Установить csv-cleaner в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
CSV Cleaner
Repair a malformed delimited file into one that parses cleanly, without silently losing data.
Core principle
Never destroy data silently. Every dropped row, merged duplicate, or coerced value must be counted and reported to the user at the end.
Workflow
1. Diagnose before touching anything
file -i input.csv # encoding
head -5 input.csv # delimiter, header shape
wc -l input.csv # row count baseline
Then attempt a strict parse (e.g. Python csv with strict=True) and record
every failure with its line number. Common findings:
| Symptom | Likely cause |
|---|---|
| Field count varies by row | unquoted delimiter inside a value |
� replacement chars |
wrong encoding assumption (try cp1252, latin-1) |
| Header repeats mid-file | concatenated exports |
| Rows of only commas | trailing padding from export tool |
2. Fix in this order
- Encoding → convert to UTF-8 first; everything downstream assumes it.
- Structural repairs → re-quote fields containing delimiters, remove repeated header rows, drop fully-empty rows.
- Header normalization → trim whitespace, deduplicate column names
(
name,name_2), only rename beyond that if the user asked. - Value normalization → only what the user requested (date formats, casing, whitespace). Do not "improve" values unprompted.
- Deduplication → only if requested. Ask which columns define identity if it is ambiguous; exact-full-row duplicates may be merged without asking.
3. Verify — this step is not optional
Re-parse the output strictly. The job is done only when all of these hold:
- Strict parse succeeds with zero errors
- Every row has the same field count as the header
-
rows_in == rows_out + rows_dropped(and each dropped row is accounted for) - Spot-check 3 rows against the original file — values survived intact
If verification fails, fix and re-verify. Never hand over a file that did not pass.
4. Report
Tell the user: what was wrong, what was changed, exact counts (rows in / out / dropped / merged), and anything that needs their judgment. Write the result to a new file — never overwrite the original.
Edge cases
- Huge files (>100 MB): stream row-by-row; never load into memory at once.
- Ambiguous delimiter (commas and semicolons present): count candidate delimiters per line across a sample; the one with a consistent count wins. If neither is consistent, ask the user.
- No header row: confirm with the user before inventing column names.
- Numeric-looking IDs with leading zeros: treat as strings; flag if asked to convert to numbers.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл csv-cleaner?
Clean and normalize messy CSV/TSV files - fix malformed rows, inconsistent headers, mixed encodings, stray delimiters, and duplicated records - and deliver a valid, verified file. Use when the user mentions a broken, messy, or malformed CSV, a file a spreadsheet tool refuses to open, or asks to deduplicate or normalize tabular data. Do not use when the deliverable is analysis or a chart rather than a cleaned file, or for Excel-native features like formulas and pivot tables.
Как установить скилл csv-cleaner?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл csv-cleaner запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…