How to Extract Numbers From Text
Enter text, choose whether to keep decimal points and repeated matches, then run the extractor to review the matched tokens and their basic statistics.
What the number extractor does
Extract Numbers is designed for text that contains number-like tokens mixed with words, labels, or other content. It can return the extracted text matches and basic calculations for non-empty input, including the quantity of matches, their total, and their arithmetic average. This is useful for reviewing amounts, measurements, IDs, scores, or other digit-based values without manually copying each one.
The tool uses simple text-matching patterns rather than interpreting the meaning of a number in context. With decimal matching enabled, a match may contain an optional minus sign, one or more digits, and an optional decimal point followed by zero or more digits. With decimal matching disabled, a match contains an optional minus sign followed by one or more digits. The decimal setting is enabled by default, while duplicate removal is disabled by default.
Step-by-step instructions
- Enter or provide the text you want to review. Text is optional, so you can also leave the input empty.
- Decide whether decimal-style matches should be included. Leave decimal matching enabled when values such as
18.50should be treated as a match that includes a decimal point. Turn it off when you want matches made from an optional minus sign and digits only. - Decide whether repeated extracted text should be removed. Leave duplicate removal off to retain repeated occurrences. Turn it on to keep the first occurrence of each distinct extracted text token.
- Run the extraction.
- Review the returned matches and the accompanying quantity, total, and average. If you supplied no text, the successful result contains no extracted values and zero-valued statistics. For non-empty text, the tool converts the extracted matches to numeric values before calculating the total and arithmetic average.
For a quick check, use a short sample containing both a repeated value and a decimal value. Compare the output with duplicate removal off and on, then check whether the decimal setting changes which text is matched. This makes the control choices easier to verify before reviewing a longer passage.
How to read the result
Read the extracted matches as text tokens first, then use the quantity, total, and average to summarize the numeric values found. When duplicate removal is off, repeated text tokens remain in the extracted results and can affect the calculations. When it is on, repeated tokens are removed while the first occurrence of each distinct token is retained, so the resulting quantity and statistics can change.
A decimal point is included only when decimal matching is enabled. Disabling that setting changes the matching pattern; it does not make the tool understand other numeric notation. The documented patterns cover an optional minus sign, digits, and, when enabled, an optional decimal point followed by zero or more digits. Text that uses a different notation or relies on surrounding labels may not be represented as you expect.
An empty or omitted input is a valid case: the result is successful, contains no extracted values, and reports zero for the statistics. For non-empty input with no matches, the average is also zero. Treat the output as a text-match summary rather than a semantic reading of the source.
Worked example
A reviewer wants to summarize order-related values while checking how a repeated order number affects the returned match list and statistics.
Provide the text “Order 1042, refund -18.50, tax 7.25, order 1042,” leave decimal matching enabled, and run the extraction once with duplicate removal off and once with it on.
The successful result contains the extracted text matches, their quantity, their total, and their arithmetic average. The shape changes when repeated matches are removed.
Limitations
- The extractor applies the documented digit-based matching patterns and calculates statistics from the matches it finds; it does not interpret every numeric notation or the meaning of surrounding text.
Common errors
- A decimal value may be handled unexpectedly when decimal matching is turned off. Turn decimal matching on when the match should include a decimal point, and review the returned text tokens before using the statistics.
FAQ
What happens if I leave the text input empty?
Yes, but the result is successful with no extracted values and zero-valued statistics when the input is empty or omitted.
Can it extract decimal numbers?
Decimal matching is enabled by default. When enabled, a match may include an optional minus sign, digits, and an optional decimal point followed by zero or more digits.
How do I remove repeated extracted numbers?
Turn on duplicate removal. The first occurrence of each distinct extracted text token is retained, and repeated tokens are removed.