✂️ CSV 去除单元格首尾空格Trim CSV Columns
去掉 CSV/TSV 单元格首尾的空格、制表符等空白,可选只处理指定列。表头也可以一起整理。Strip leading and trailing spaces, tabs and other whitespace from CSV/TSV cells, optionally only in chosen columns. Headers can be trimmed too.
使用说明与常见问题How-to & FAQ
「CSV 去除单元格首尾空格」是什么?What is the Trim CSV Columns tool?
去掉 CSV/TSV 单元格首尾的空格、制表符等空白,可选只处理指定列。表头也可以一起整理。Strip leading and trailing spaces, tabs and other whitespace from CSV/TSV cells, optionally only in chosen columns. Headers can be trimmed too.
如何使用「CSV 去除单元格首尾空格」?How do I use the Trim CSV Columns tool?
在「CSV 去除单元格首尾空格」中,把内容粘贴或输入到上方输入框,按需设置「列(留空 = 全部)」,结果会实时显示在下方,点击「复制结果」即可复制。Paste your CSV. Leading and trailing spaces are removed from every cell, or only from the columns you list under "Columns". Untick "Also trim the header" to leave the header row alone. Click "Copy result" to copy the output.
中间的空格会去掉吗?Are spaces in the middle removed?
不会,只去首尾空白;单元格内部的空格保留。No — only leading and trailing whitespace; spaces inside the value stay.
不勾选“同时整理表头”呢?What if Also trim the header is off?
表头行原样保留,只整理数据行。The header row is left unchanged and only data rows are trimmed.
输入和输出是什么样的?What does the input and output look like?
例如在「CSV 去除单元格首尾空格」中输入 a,b ⏎ 1 , 2,输出为:a,b ⏎ 1,2(⏎ 表示换行)。The input a,b ⏎ 1 , 2 becomes a,b ⏎ 1,2 (⏎ marks a line break).
有哪些选项可以调整?What options can I adjust?
「CSV 去除单元格首尾空格」的设置:「列(留空 = 全部)」可留空;可勾选:「第一行是表头」(默认勾选)、「同时整理表头」(默认勾选)。改动任一选项后结果会按新设置重新生成。You can adjust "Columns (blank = all)" (optional); and the "First row is a header" (on by default) and "Also trim the header" (on by default) checkboxes. 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.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「CSV 去除单元格首尾空格」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Trim CSV Columns tool runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「CSV 去除单元格首尾空格」免费吗?需要注册吗?Is the Trim CSV Columns tool free? Do I need an account?
「CSV 去除单元格首尾空格」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Trim 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.