CSV 是什么What CSV Is
CSV(Comma-Separated Values,逗号分隔值)是一种用纯文本存储表格数据的文件格式。每一行代表一条记录,行内用逗号把不同字段(列)分开。它不包含字体、颜色、公式等样式信息,正因为"简单",才成为程序与程序之间交换数据的通用语言。
CSV (Comma-Separated Values) is a plain-text file format for tabular data. Each line is a record, and commas separate the fields (columns) within a line. It carries no fonts, colors or formulas — and that simplicity is exactly why it became the universal language for exchanging data between programs.
一个最简单的 CSV 看起来像这样:
A minimal CSV looks like this:
姓名,邮箱,城市
张三,zhangsan@example.com,北京
李四,lisi@example.com,上海
三个必须知道的概念Three Concepts You Must Know
1. 分隔符不一定是逗号1. The delimiter isn't always a comma
虽然名字叫"逗号分隔",但很多地区用分号(;)作为分隔符(例如欧洲版 Excel),还有的用制表符(Tab)形成 TSV。365Lab CSV 工具支持自动识别分隔符,省去手动设置的麻烦。
Despite the name, many locales use a semicolon (;) — e.g. European Excel — and some use a tab, producing TSV. 365Lab CSV Tools auto-detects the delimiter so you don't have to set it manually.
2. 编码决定中文会不会乱码2. Encoding decides whether Chinese turns to gibberish
编码(如 UTF-8、GBK、Big5)决定了文字如何存成字节。用错编码打开,就会看到"浣犲ソ"这样的乱码。这正是"编码转换"功能存在的意义——详见我们的CSV 乱码修复教程。
Encoding (UTF-8, GBK, Big5…) decides how text becomes bytes. Open a file with the wrong encoding and you get gibberish like "浣犲ソ". That's why the Encoding tool exists — see our garbled-text fix guide.
3. 引号用来"保护"包含分隔符的内容3. Quotes "protect" fields that contain delimiters
当某个字段本身含有逗号时,需要用双引号把它包起来,例如 "北京市,朝阳区"。标准 CSV 还能用两个双引号表示一个真正的引号。理解这一点,能避免数据被错误拆列。
When a field itself contains a comma, wrap it in double quotes, e.g. "Beijing, Chaoyang". The standard also uses two double quotes to represent one real quote. Understanding this prevents columns from splitting incorrectly.
CSV 的常见误区Common CSV Myths
- "CSV 只能存数字":错。CSV 存的是文本,任何内容(文字、日期、公式结果)都会以文本形式保存。
- "用 Excel 打开后还是 CSV":错。在 Excel 里改完再"保存",通常会变成 .xlsx;要保留 CSV 需显式"另存为 CSV"。
- "CSV 有统一标准":不完全。RFC 4180 是事实标准,但不同软件在分隔符、换行、引号上仍有差异。
- "CSV only stores numbers": No. CSV stores text; everything (words, dates, formula results) is saved as text.
- "Opening in Excel keeps it CSV": No. Editing then "Save" usually produces .xlsx; you must explicitly "Save as CSV" to keep the format.
- "CSV has one universal standard": Not quite. RFC 4180 is the de-facto standard, but software still differs on delimiters, line breaks and quoting.
为什么 CSV 如此流行Why CSV Is So Popular
因为它"人人能读":任何编程语言、数据库、电子表格甚至记事本都能处理。导出报表、备份数据、做数据迁移时,CSV 几乎总是最稳妥的中间格式。配合 365Lab 在线 CSV 工具箱,你可以在浏览器里完成解析、转换、清洗、合并,且数据不上传服务器,安全隐私。
Because everyone can read it: any programming language, database, spreadsheet or even Notepad can handle it. For exporting reports, backing up data or migrating, CSV is almost always the safest interchange format. With the 365Lab online CSV toolkit you can parse, convert, clean and merge right in your browser — your data never leaves your device.
想马上试试?打开在线工具,拖入你的 CSV 即可解析预览,全程本地处理。
Want to try now? Open the toolkit and drop in your CSV to preview it — everything runs locally.