Supplier catalogs

How to remove text prefixes and units from a supplier price list

2026-06-29
Task

A supplier table stores price and stock as text: Price: USD 24.90 and Stock: 12 pcs. The import needs clean numeric fields price_clean and stock_clean.

Short answer

If the text format may vary, extract the number with the regular expression [0-9]+(?:[,.][0-9]+)? (finds an integer or decimal number: one or more digits plus an optional decimal part after a dot or comma). If prefixes and units are stable across the file, remove them with substring rules.

How to do it in Eofferix

Method 1: use a regular expression in Eofferix

  1. Create the output column price_clean from price_raw and open its settings.

    Opening price_clean settings
    The animation shows opening the output column settings.
  2. Add a rule: condition Regular expression, value [0-9]+(?:[,.][0-9]+)? (finds an integer or decimal number: one or more digits plus an optional decimal part after a dot or comma), action Remove everything except.

    Regular expression for cleaning price
    The rule keeps only the number from the price and removes surrounding text.

Method 2: use substring search in Eofferix

  1. If the strings are stable, create price_clean_text and remove the substrings Price: USD and .

    Substring rules for price
    Substrings are useful when the supplier always uses the same prefix and unit.
  2. For stock, create stock_clean and remove the substrings Stock: and pcs.

    Substring rules for stock
    After both removals, only the stock number remains.

Before / after

Before

source data
vendor_codenameprice_rawstock_raw
VN-1001Hudson lampPrice: USD 24.90Stock: 12 pcs
VN-1002Parker chairPrice: USD 139.00Stock: 0 pcs

After

result
vendor_codenameprice_cleanstock_clean
VN-1001Hudson lamp24.9012
VN-1002Parker chair139.000

What to keep in mind

  • A regular expression is safer when currency can appear before or after the number.
  • Substring rules are simpler for stable prefixes such as Price: USD and units such as pcs.
  • Check several preview rows first: zero stock should remain 0, not become an empty value.

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up