본문으로 건너뛰기
cccskills
무료GitHub에 공개

csv-pro

CSV processing done right — parsing edge cases, dialects, and large files — use when ingesting or exporting CSV data.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Excel
설치 방법 보기

포함된 파일(1)

  • SKILL.md3.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Overview

CSV looks trivial until it isn't: embedded newlines, quoted commas, BOMs, inconsistent dialects, and million-row files. This skill covers robust CSV parsing and generation — the unglamorous work that keeps data pipelines from silently corrupting data.

When to use

  • Parsing user-uploaded or third-party CSVs with unknown dialects
  • Generating CSV exports that open correctly in Excel and other tools
  • Streaming multi-gigabyte CSV files without loading them into memory
  • Validating CSV schemas (headers, types, required columns)
  • Handling encoding issues (BOM, Latin-1 vs UTF-8)

Core concepts

Never split on commas. Real CSV has quoted fields containing commas, newlines, and escaped quotes (""). Always use a proper CSV parser from your language's standard library or a battle-tested package — hand-rolled splitting is a bug factory.

Dialects vary. Delimiter (comma, semicolon, tab, pipe), quote character, escape style, and line endings differ by producer and locale (much of Europe uses ; because , is the decimal separator). Sniff the dialect from a sample when it's unknown, but let users override — sniffing is heuristic.

Encoding: expect UTF-8 with BOM. Excel writes UTF-8 CSVs with a BOM; strip it or your first header becomes \ufeffid. For unknown encodings, try UTF-8, then fall back to likely candidates (Windows-1252 for Western data) — and log when you guess.

Headers are data, not gospel. Normalize them (trim, lowercase, deduplicate) and validate against an expected schema. Map by name, not position — column order changes. Report unknown/missing columns explicitly rather than silently ignoring them.

Stream large files. Process row-by-row with iterators/generators; never load a 2GB CSV into a list of dicts. Validate and transform in the streaming pass, collecting only error summaries and aggregates in memory.

Practical workflow

  1. Detect: read a sample — sniff delimiter, check for BOM, detect encoding, locate the header row (not always row 1).
  2. Define the schema: expected columns, types, required fields, value constraints; normalize header names.
  3. Parse streaming: iterate rows, coerce types per column with clear error messages including the row number and raw value.
  4. Validate: collect all errors (don't fail on the first); distinguish fatal (wrong columns) from row-level (bad value in row 4521).
  5. Generate: write with the standard library writer, QUOTE_MINIMAL, \r\n line endings for Excel compatibility, UTF-8 with BOM if the audience is Excel users, and a header row always.
  6. Test with adversarial fixtures: quoted commas, embedded newlines, empty fields, trailing delimiters, mixed line endings, and a 1M-row file for the streaming path.

Common pitfalls

  • Hand-rolled line.split(',') — breaks on the first quoted comma; use a real parser, always.
  • Ignoring the BOM — invisible character corrupts the first column name and breaks header mapping.
  • Loading everything into memory — fine for 10k rows, fatal for 10M; stream by default.
  • Silent type coercion — "0123" becoming 123 loses leading zeros (zip codes, SKUs); coerce deliberately per column, not globally.
  • Excel mangling your output — long digit strings become scientific notation, dates get reinterpreted; for Excel audiences consider prefixing with = or quoting, and document the behavior.
  • No row numbers in error messages — "invalid value" without a row number is unactionable; always report where the problem is.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Master 1Password: vaults, Watchtower, passkeys, SSH agent, CLI, and family/team administration. Use when getting full value from 1Password personally or administering it for others.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills252026년 10월 10일 업데이트

Create 3D visuals with modeling, texturing, lighting, rendering, and optimization for web and product.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills252026년 10월 10일 업데이트

Create 3D web experiences: scene setup, models, materials, lighting, animation, scroll-driven scenes, and performance budgets. Use when adding 3D to websites beyond basic demos.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills252026년 10월 10일 업데이트

Writing abstracts that get papers read — structured content, the 5-sentence core, and journal-specific constraints.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills252026년 10월 10일 업데이트

Learn effectively from courses and academies: choosing programs, studying actively, and converting courses into skills. Use when investing time/money in structured learning.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills252026년 10월 10일 업데이트

Audit designs for accessibility with WCAG checklists covering color, type, focus, motion, and content.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

aicodedecode/awesome-muse-skills252026년 10월 10일 업데이트

aicodedecode의 스킬 모두 보기

이 스킬의 문제 신고