Supplier catalogs

How to extract delivery time in days from a supplier XML feed

2026-06-28
Task

The supplier XML feed sends delivery time as text: 3-5 days, 14 days, sometimes on request. The catalog needs a numeric lead time for filtering and sorting.

Short answer

Open the delivery_time value settings and add a rule: condition Regular expression, value \d+ (finds one or more digits in a row), action Remove everything except.

How to do it in Eofferix

  1. Open the delivery_time value settings in the XML editor.

    Opening delivery_time value settings in the XML editor
    The animation opens the XML node value settings, not the whole offer element.
  2. Add a rule: condition Regular expression, value \d+ (finds one or more digits in a row), action Remove everything except.

    Rule for extracting day count from XML delivery_time
    The rule keeps the first number found and removes the text unit.
  3. Save the settings and test values with a range, a single number, and text without a number.

Before / after

Before

source data
<catalog>
  <offers>
    <offer id="4001"><sku>SKU-4001</sku><name>Hudson lamp</name><delivery_time>3-5 days</delivery_time><stock>12</stock></offer>
    <offer id="4002"><sku>SKU-4002</sku><name>Parker chair</name><delivery_time>14 days</delivery_time><stock>4</stock></offer>
  </offers>
</catalog>

After

result
<catalog>
  <offers>
    <offer id="4001"><sku>SKU-4001</sku><name>Hudson lamp</name><delivery_time>3</delivery_time><stock>12</stock></offer>
    <offer id="4002"><sku>SKU-4002</sku><name>Parker chair</name><delivery_time>14</delivery_time><stock>4</stock></offer>
  </offers>
</catalog>

What to keep in mind

  • For a range such as 3-5 days, this rule keeps the first number: 3. If you need the maximum time, use a separate expression for the number after the dash.
  • For values without a number, such as on request, add a replacement rule or an export condition.
  • This works well for large XML feeds where delivery time must become a numeric catalog field.

Process data faster with Eofferix

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

Sign up