🗑️ CSV 删除列Delete CSV Columns
按列号或表头名删除 CSV/TSV 中的一列或多列,其它列保持不变。自动识别分隔符;长度不齐的行保持原长度,只删除它实际有的列。Delete one or more columns from a CSV or TSV by number or header name; the other columns stay as they are. The delimiter is detected; rows of uneven length keep their own length and only lose the columns they actually have.
使用说明与常见问题How-to & FAQ
「CSV 删除列」是什么?What is the Delete CSV Columns tool?
按列号或表头名删除 CSV/TSV 中的一列或多列,其它列保持不变。自动识别分隔符;长度不齐的行保持原长度,只删除它实际有的列。Delete one or more columns from a CSV or TSV by number or header name; the other columns stay as they are. The delimiter is detected; rows of uneven length keep their own length and only lose the columns they actually have.
如何使用「CSV 删除列」?How do I use the Delete CSV Columns tool?
在「CSV 删除列」中,把内容粘贴或输入到上方输入框,按需设置「要删除的列(列号或表头名)」,结果会实时显示在下方,点击「复制结果」即可复制。Paste your CSV, then type the columns to remove in "Columns to delete" — numbers such as 2,4 or header names such as city. The remaining columns appear below; click "Copy result" to copy them.
怎么指定列?How do I choose columns?
填列号(最左边是 1)或表头名,多个用逗号分隔,例如 2,4 或 age,city。Give column numbers (leftmost is 1) or header names, separated by commas: 2,4 or age,city.
删错了怎么办?What if I delete the wrong columns?
本工具不改原文件,只显示结果;用浏览器撤销或重新粘贴原文即可。The tool never overwrites your file — it only shows the result; undo in the browser or paste the original again.
输入和输出是什么样的?What does the input and output look like?
例如在「CSV 删除列」中输入 name,age,city ⏎ Tom,18,NYC,输出为:name,city ⏎ Tom,NYC(⏎ 表示换行)。The input name,age,city ⏎ Tom,18,NYC becomes name,city ⏎ Tom,NYC (⏎ marks a line break).
有哪些选项可以调整?What options can I adjust?
「CSV 删除列」的设置:「要删除的列(列号或表头名)」默认 2;可勾选:「第一行是表头」(默认勾选)。改动任一选项后结果会按新设置重新生成。You can adjust "Columns to delete (number or header)" (default: 2); and the "First row is a header" (on by default) checkbox. The result updates as soon as you change a setting.
行长度不一致(有的行字段多、有的行字段少)时会怎样?What happens when rows have different numbers of fields?
不会凭空补字段,也不会删掉字段:操作只作用于每行实际存在的字段,每行保持自己原来的长度。比如某行没有要处理的那一列,这一行就原样保留。检测到这种行时,结果下方会有一行提示说明有几行。需要统一列数时,请用“CSV 补齐不完整行”。No fields are invented or dropped: the operation only touches the fields each row actually has, and every row keeps its own length. If a row does not have the column being changed, that row is left as it is. When such rows are found, a one-line note below the result says how many. To give every row the same number of fields, use Fill Incomplete CSV Records.
表头里有重名的列,或者同一列写了两次会怎样?What if two columns share a header name, or I list a column twice?
按名字选择时只会用到第一个同名列,结果下方会给出提示,列出所有同名列的位置;要选其他同名列请直接写列号。同一列写了两次(例如 1,1)只算一次,也会提示是哪一列。A header name picks the first column with that name, and a note below the result lists every column that shares it; use a column number to pick another one. A column listed twice (for example 1,1) is used once, and the note names it.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「CSV 删除列」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Delete CSV Columns tool runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「CSV 删除列」免费吗?需要注册吗?Is the Delete CSV Columns tool free? Do I need an account?
「CSV 删除列」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Delete CSV Columns tool is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.