🔍

首页Home › 文本工具Text Tools

📏 按行长度过滤文本Filter Lines by Length

按每行的字数筛选文本:保留或删除长度在指定范围内的行,可按字符数或字节数计算,并可按长度排序,适合清洗词表、关键词和日志。Filter lines by length: keep or drop lines whose length falls in a range, counted in characters or bytes, and optionally sort by length — great for cleaning word lists, keywords and logs.

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

「按行长度过滤文本」是什么?What is the Filter Lines by Length tool?

按每行的字数筛选文本:保留或删除长度在指定范围内的行,可按字符数或字节数计算,并可按长度排序,适合清洗词表、关键词和日志。Filter lines by length: keep or drop lines whose length falls in a range, counted in characters or bytes, and optionally sort by length — great for cleaning word lists, keywords and logs.

如何使用「按行长度过滤文本」?How do I use the Filter Lines by Length?

粘贴多行文本,填写最小和最大长度(留空表示不限),选择保留还是删除这些行。中文一个字算 1 个字符;选择「UTF-8 字节」时一个汉字算 3 字节。Paste lines, enter the minimum and maximum length (blank = no limit) and choose whether to keep or drop matching lines. Each Chinese character counts as 1 character, or 3 when counting UTF-8 bytes.

为什么同一行用字节数算出来更长?Why is the byte count larger?

UTF-8 中英文字母、数字占 1 字节,常用汉字占 3 字节,Emoji 占 4 字节。数据库 VARCHAR 按字节限制时应选择字节计数。In UTF-8 Latin letters and digits take 1 byte, common Chinese characters 3 and emoji 4. Use bytes when a database column limits bytes.

「宽度」是什么?What is Width?

按等宽显示时的占位宽度计算:中文、日文、韩文和全角符号算 2,其他算 1,适合对齐终端或表格。Display width in a monospace font: CJK and full-width characters count 2, others 1 — useful for aligning terminals or tables.

「按行长度过滤文本」免费吗?数据会上传吗?Is the Filter Lines by Length free? Is my data uploaded?

「按行长度过滤文本」完全免费,无需注册或安装,手机和电脑都能用;所有处理都在你的浏览器本地完成,输入的内容和文件不会上传到服务器。The Filter Lines by Length is completely free with no sign-up or install and works on phones and desktops; everything runs locally in your browser and nothing you enter is uploaded.

相关工具Related tools

🚫 去除标点符号Remove Punctuation␣ 去除多余空格Remove Extra Spaces🧽 删除空行Remove Empty Lines🧹 删除重复行Remove Duplicate Lines🧹 按关键词筛选行Filter Lines by Keyword🔠 大小写转换Case Converter🔢 字数统计Word & Character Counter↩️ 去除换行Remove Line Breaks

← 全部工具All tools