← 返回
未分类 中文

Csv Parser Local

Parse and generate RFC 4180 compliant CSV that works across tools.
解析并生成符合 RFC 4180 标准的 CSV,跨工具兼容。
panchenbo panchenbo 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 495
下载
💾 2
安装
1
版本
#latest

概述

Quoting Rules

  • Fields containing comma, quote, or newline MUST be wrapped in double quotes
  • Double quotes inside quoted fields escape as "" (two quotes), not backslash
  • Unquoted fields with leading/trailing spaces—some parsers trim, some don't; quote to preserve
  • Empty field ,, vs empty string ,"",—semantically different; be explicit

Delimiters

  • CSV isn't always comma—detect ; (European Excel), \t (TSV), | in legacy systems
  • Excel exports use system locale delimiter; semicolon common in non-US regions
  • Sniff delimiter from first line but verify—header might not contain special chars

Encoding

  • UTF-8 BOM (0xEF 0xBB 0xBF) breaks naive parsers but Excel needs it for UTF-8 detection
  • When generating for Excel on Windows: add BOM; for programmatic use: omit BOM
  • Latin-1 vs UTF-8 ambiguity—explicitly declare or detect encoding before parsing

Common Parsing Failures

  • Newlines inside quoted fields are valid—don't split on \n before parsing
  • Unescaped quote in middle of field corrupts rest of file—validate early
  • Trailing newline at EOF—some parsers create empty last row; strip or handle
  • Inconsistent column count per row—validate all rows match header count

Numbers & Dates

  • 1,234.56 vs 1.234,56—locale-dependent; standardize or document format
  • Dates: ISO 8601 (2024-01-15) only unambiguous format; 01/02/24 is chaos
  • Leading zeros in numeric fields (007)—quote to preserve or document as string

Excel Quirks

  • Formula injection: fields starting with =, +, -, @ execute as formulas—prefix with ' or tab
  • Long numbers (>15 digits) lose precision—quote and format as text
  • Scientific notation triggered by E in numbers—quote if literal text needed

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 10:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 679 📥 327,930
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 182,002
data-analysis

Chart Data Viz

panchenbo
本地优先的图表生成引擎,支持趋势、比较、分布及快速可视化说明。适用于用户需要可视化数据的场景。
★ 0 📥 786