⬅️ CSV 开头插入列Prepend Columns to CSV
在 CSV/TSV 表格的最左边插入一列或多列(比如序号列、ID 列):填写新列名和填充值,也可以自动填入行号。自动识别分隔符,正确处理带引号的单元格。Put one or more columns in front of a CSV or TSV table — an index or ID column, say. Give the new column names and a fill value, which can include the row number. The delimiter is detected and quoted cells are handled.
使用说明与常见问题How-to & FAQ
「CSV 开头插入列」是什么?What is the Prepend Columns to CSV tool?
在 CSV/TSV 表格的最左边插入一列或多列(比如序号列、ID 列):填写新列名和填充值,也可以自动填入行号。自动识别分隔符,正确处理带引号的单元格。Put one or more columns in front of a CSV or TSV table — an index or ID column, say. Give the new column names and a fill value, which can include the row number. The delimiter is detected and quoted cells are handled.
如何使用「CSV 开头插入列」?How do I use the Prepend Columns to CSV tool?
在「CSV 开头插入列」中,把内容粘贴或输入到上方输入框,按需设置「新列名(逗号分隔)」、「填充值({n} = 行号)」,结果会实时显示在下方,点击「复制结果」即可复制。In the Prepend Columns to CSV: Paste or type into the input box, adjust "New column names (comma separated)", "Fill value ({n} = row number)"; the result appears below instantly — click "Copy result" to copy it.
常见用途是什么?What is it typically used for?
最常见的是给表格加一个序号列(新列名填“序号”,填充值填 {n}),或者在导入数据库前加一个固定值的分类列、来源列。Most often to add a row-number column (name it 'No', fill value {n}), or to add a fixed category or source column before importing into a database.
填充值里的 {n} 是什么?What does {n} in the fill value do?
{n} 会被替换成数据行的序号(表头不算,从 1 开始),比如填 ID-{n} 会得到 ID-1、ID-2……留空则新列是空单元格。所有新列使用同一个填充值。{n} is replaced with the data row number (the header doesn't count; it starts at 1), so ID-{n} gives ID-1, ID-2 and so on. Leave it blank for empty cells. Every new column gets the same fill value.
不勾选“第一行是表头”会怎样?What if 'First row is a header' is off?
那么每一行(包括第一行)都当作数据行,都会填入填充值;新列名只用来决定要加几列。Then every row, the first included, is a data row and gets the fill value; the new column names only decide how many columns are added.
含逗号或引号的单元格会被破坏吗?Will cells with commas or quotes break?
不会。输入按 CSV 规则解析(带引号的单元格里可以有逗号、引号和换行),输出时需要引号的单元格会重新加上引号,分隔符保持和输入一致。行长度不齐时先补齐空单元格,空行原样保留。No. The input is parsed by CSV rules (quoted cells may contain commas, quotes and line breaks), cells that need quotes get them again on output, and the delimiter stays the same as the input. Short rows are padded with empty cells first, and blank lines are kept.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「CSV 开头插入列」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Prepend Columns to CSV runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「CSV 开头插入列」免费吗?需要注册吗?Is the Prepend Columns to CSV free? Do I need an account?
「CSV 开头插入列」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Prepend Columns to CSV is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.