Table editor

How to Extract Pack Quantity from Text

2026-06-20

Task

The pack quantity is inside text, for example Box, pack 12 pcs. The output table needs pack_qty.

Short answer

Create pack_qty and keep the number before pcs or units with \d+(?:[,.]\d+)?(?=\s*(?:pcs?|units?)).

How to Do It in Eofferix

  1. Open the settings of the output pack_qty column.
    Animation showing how to open the pack_qty column settings
    The click is on the settings icon of the pack_qty column.
  2. In Transformations, add \d+(?:[,.]\d+)?(?=\s*(?:pcs?|units?)) with Remove everything except.
    Screenshot of transformation rules for the pack_qty column
    The Transformations block shows the full rule chain for this case.
  3. Save the column settings and go to the Export step.

Before / After

Before

source data
skupackage_text
SKU-900Box, pack 12 pcs
SKU-901Bag 6 pcs

After

result
skupack_qty
SKU-90012
SKU-9016

Process data faster with Eofferix

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

Sign up