跳到主要内容
Z

What is CSV?

CSV (Comma-Separated Values) is a plain-text format for tabular data, where each line is a row and fields are separated by commas. It is simple, compact and supported by every spreadsheet and data tool, but has no types, no nesting and no formal standard for quoting.

Each CSV line is a record; the first line is usually a header naming the columns. Fields containing commas, quotes or newlines are wrapped in double quotes. Everything is text — there are no numbers, booleans or nested structures.

CSV is ideal for exporting and importing flat, tabular data between spreadsheets, databases and analysis tools. For nested or typed data, JSON is a better fit.

CSV tools

常见问题

NULL 是如何识别的?

任何空白单元格都会被转换为 NULL(不加引号)。如果你想插入空字符串而不是 NULL,可以在该单元格中填入一个空格,或直接编辑生成的 SQL 结果。

工具是否支持 Postgres 特有的数据类型,比如 JSONB?

不支持——列类型推断仅限于 INT、DECIMAL、TEXT。如果你需要 JSONB、ARRAY 或其他扩展类型,请自行修改 CREATE TABLE 语句。

生成的 SQL 结果会自动美化格式吗?

每一行对应一条语句。如需更美观的格式,可以将结果输入 <a class="text-brand-600 hover:underline" href="/sql-formatter">SQL Formatter</a> 进行处理。

有哪些相关工具?

可以使用 <a class="text-brand-600 hover:underline" href="/csv-to-json">CSV to JSON</a> 转换为通用的 JSON 格式,或使用 <a class="text-brand-600 hover:underline" href="/csv-to-xml">CSV to XML</a> 导出为 XML。