🔍 从文本中提取整数Extract Integers from Data
从任意文本中提取整数(含负数、千位逗号),按出现顺序列出。适合从日志、表格粘贴中捞数字,本地处理。Extract integers (including negatives and thousands commas) from arbitrary text, in order of appearance. Handy for pulling numbers from logs or pasted tables. Processed locally.
使用说明与常见问题How-to & FAQ
「从文本中提取整数」是什么?What is the Extract Integers from Data tool?
从任意文本中提取整数(含负数、千位逗号),按出现顺序列出。适合从日志、表格粘贴中捞数字,本地处理。Extract integers (including negatives and thousands commas) from arbitrary text, in order of appearance. Handy for pulling numbers from logs or pasted tables. Processed locally.
如何使用「从文本中提取整数」?How do I use the Extract Integers from Data tool?
在「从文本中提取整数」中,把内容粘贴或输入到上方输入框,按需设置「分隔」,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「price 1,234 and -5 pcs」,得到「1234 ⏎ -5」。Paste any text, such as a log or a copied table. Every integer in it, including negatives and numbers with thousands commas, is listed in order of appearance (price 1,234 and -5 pcs gives 1234 and -5); choose the "Separator" for the list and click "Copy result" to copy it.
结果精确吗?Are the results exact?
精确。所有整数都按大整数(BigInt)处理,不经过浮点,超过 2^53 的数(例如 9007199254740993)也不会被舍入;几千上万行也是线性处理。Yes. Every value is handled as a big integer (BigInt) with no floating-point step, so numbers above 2^53 such as 9007199254740993 are never rounded; thousands of lines are processed in linear time.
负号和连字符怎么区分?How are minus signs and hyphens told apart?
数字前的 -、−、- 算负号(例如 a-12、Temp -3°C);夹在两个数字之间的连字符算分隔符,所以日期 2026-10-20 得到 2026、10、20,范围 5-10 得到 5、10。A minus sign (hyphen, U+2212 or fullwidth) in front of a number is a minus sign (a-12, Temp -3°C). A hyphen between two digits is a separator, so the date 2026-10-20 gives 2026, 10, 20 and the range 5-10 gives 5, 10.
小数会怎样?What happens to decimals?
小数(例如 3.5、1.5.2)不是整数,会整段跳过,不会拆成 3 和 5;结果说明里会显示跳过了几个。全角数字(123)会按半角处理。Decimals such as 3.5 or 1.5.2 are not integers, so they are skipped whole instead of being split into 3 and 5; the info line shows how many were skipped. Fullwidth digits are read as normal digits.
1e3、0x10、1_000 这类写法呢?What about 1e3, 0x10 and 1_000?
科学计数(1e3、2.5E-3)和十六进制(0x10)不是普通整数写法,会整段跳过,不会拆成 1 和 3,结果说明里会显示跳过了几个;数字间的下划线是分组写法,1_000 读作 1000(与“整数分析”一致)。10x20 这样的尺寸写法按两个数 10、20 提取。Scientific notation (1e3, 2.5E-3) and hex (0x10) are not plain integers, so they are skipped whole instead of being split into 1 and 3, and the info line shows how many were skipped. Underscores between digits are digit grouping, so 1_000 reads as 1000 (as in Analyze Integers). A size such as 10x20 gives the two numbers 10 and 20.
有哪些选项可以调整?What options can I adjust?
「从文本中提取整数」的设置:「分隔」可选 每行一个、空格、逗号、分号(默认 每行一个);可勾选:「千位逗号」。改动任一选项后结果会按新设置重新生成。Settings in the Extract Integers from Data — "Separator": One per line, Spaces, Commas, Semicolons (default One per line); tick boxes: "Thousands commas". Changing any option regenerates the result with the new setting.
「从文本中提取整数」免费吗?需要注册吗?Is the Extract Integers from Data free? Do I need an account?
「从文本中提取整数」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Extract Integers from Data is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.