Task
The supplier mixes numbers and text in the stock column: 10+, >10, out of stock, preorder. The import needs a numeric stock value.
Short answer
First keep the number with \d+. For text values, add replacements to 0.
How to Do It in Eofferix
- Open the settings of the output
stockcolumn.
The click is on the settings icon of the stockcolumn. - Add
\d+withRemove everything except, thenout of stock→0andpreorder→0.
The Transformationsblock shows the full rule chain for this case. - Save the column settings and go to the
Exportstep.
Before / After
Before
source data| sku | stock_raw |
|---|---|
| SKU-500 | 10+ |
| SKU-501 | >10 |
| SKU-502 | out of stock |
| SKU-503 | preorder |
After
result| sku | stock |
|---|---|
| SKU-500 | 10 |
| SKU-501 | 10 |
| SKU-502 | 0 |
| SKU-503 | 0 |