🔍

首页Home › 开发工具Developer Tools

📏 CSV 截断单元格(限制最大长度)Truncate CSV Columns

把 CSV/TSV 指定列(或全部列)的单元格截断到最大字符数,可选加省略号。适合清理过长备注、生成预览。Truncate CSV/TSV cells in chosen columns (or all columns) to a maximum character length, with an optional ellipsis. Handy for long notes and previews.

使用说明与常见问题How-to & FAQ

「CSV 截断单元格(限制最大长度)」是什么?What is the Truncate CSV Columns tool?

把 CSV/TSV 指定列(或全部列)的单元格截断到最大字符数,可选加省略号。适合清理过长备注、生成预览。Truncate CSV/TSV cells in chosen columns (or all columns) to a maximum character length, with an optional ellipsis. Handy for long notes and previews.

如何使用「CSV 截断单元格(限制最大长度)」?How do I use the Truncate CSV Columns tool?

在「CSV 截断单元格(限制最大长度)」中,把内容粘贴或输入到上方输入框,按需设置「列(留空 = 全部)」、「最大长度」,结果会实时显示在下方,点击「复制结果」即可复制。Paste your CSV, set "Max length" in characters and, if you like, list the columns to shorten. With "Append ellipsis" on, shortened cells end with … and the ellipsis counts toward the limit. Click "Copy result" to copy the output.

长度按什么计算?How is length counted?

按 Unicode 码点(大体上是“字符”),emoji 等算 1 个;加省略号时省略号占 1 个长度。Unicode code points (roughly characters); an emoji counts as one. With an ellipsis, the … uses one of the max length.

截断后引号还正确吗?Are quotes still correct after truncating?

会按 CSV 规则重新输出,含分隔符的截断结果仍会加引号。Yes — rewritten with CSV rules, so truncated values that contain the delimiter stay quoted.

输入和输出是什么样的?What does the input and output look like?

例如在「CSV 截断单元格(限制最大长度)」中输入 a,b ⏎ hello world,x,「最大长度」设为 5,「列(留空 = 全部)」设为 1,输出为:a,b ⏎ hell…,x(⏎ 表示换行)。With "Max length" set to 5 and "Columns (blank = all)" set to 1, the input a,b ⏎ hello world,x becomes a,b ⏎ hell…,x (⏎ marks a line break).

有哪些选项可以调整?What options can I adjust?

「CSV 截断单元格(限制最大长度)」的设置:「列(留空 = 全部)」可留空;「最大长度」默认 20;可勾选:「末尾加省略号 …」(默认勾选)、「第一行是表头」(默认勾选)、「也截断表头」。改动任一选项后结果会按新设置重新生成。You can adjust "Columns (blank = all)" (optional); "Max length" (default: 20); and the "Append ellipsis …" (on by default), "First row is a header" (on by default) and "Also truncate the header" 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 Truncate CSV Columns tool runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.

「CSV 截断单元格(限制最大长度)」免费吗?需要注册吗?Is the Truncate CSV Columns tool free? Do I need an account?

「CSV 截断单元格(限制最大长度)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Truncate 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.

相关工具Related tools

✂️ CSV 去除单元格首尾空格Trim CSV Columns🔗 CSV URL 编码(编码单元格)URL-Encode CSV🔓 CSV URL 解码(解码单元格)URL-Decode CSV🔀 十六进制 OR 运算(按位或)OR Hex Numbers⊼ 十六进制 NAND 运算(与非)NAND Hex Numbers⊕ 十六进制 XOR 运算(按位异或)XOR Hex Numbers🔁 反转十六进制数字Reverse Hex Digits🔄 循环移动十六进制数字Rotate Hex Digits🔀 打乱十六进制数字(可复现种子)Shuffle Hex Digits🎲 随机十六进制数生成器Generate Random Hexadecimal Numbers🚫 JSON 打码(隐藏敏感字段)Censor JSON🔑 提取 JSON 键名Extract JSON Keys

← 全部工具All tools