Supplier catalogs

How to clean currency text from prices in a supplier JSON catalog

2026-06-29
Task

In the JSON catalog, price.amount is stored as USD 24.90. The import field should contain only the number, while price.currency keeps the currency code.

Short answer

For varying currency strings, use 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 the format is always USD 24.90, you can remove the USD substring.

How to do it in Eofferix

Method 1: use a regular expression in Eofferix

  1. In the JSON snapshot, select the amount value inside price.

    JSON price amount field
    The selected value will be cleaned before export.
  2. Open the value settings.

    Opening amount in JSON
    The animation shows opening the JSON value settings.
  3. 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.

    amount cleanup rule
    The rule keeps only the number from the currency string.

Method 2: use substring search in Eofferix

  1. If the currency is always written the same way, use a substring rule: remove USD or another stable fragment from amount.

Before / after

Before

source data
{
    "supplier": "Northline",
    "products": [
        {
            "sku": "SKU-3001",
            "name": "Hudson lamp",
            "price": {
                "amount": "USD 24.90",
                "currency": "USD"
            }
        },
        {
            "sku": "SKU-3002",
            "name": "Parker chair",
            "price": {
                "amount": "USD 139.00",
                "currency": "USD"
            }
        }
    ]
}

After

result
{
    "supplier": "Northline",
    "products": [
        {
            "sku": "SKU-3001",
            "name": "Hudson lamp",
            "price": {
                "amount": "24.90",
                "currency": "USD"
            }
        },
        {
            "sku": "SKU-3002",
            "name": "Parker chair",
            "price": {
                "amount": "139.00",
                "currency": "USD"
            }
        }
    ]
}

What to keep in mind

  • Do not remove the currency field if the import or validation still needs it.
  • The English example uses USD, Spanish and French use EUR, and Russian uses RUB.
  • If the supplier changes decimal separators, the regular expression is safer than a substring.

Process data faster with Eofferix

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

Sign up