Table transformations

How to convert weight from grams to kilograms

2026-06-20
Task

A table has weight in grams, sometimes with a suffix such as g. The final field must contain weight in kilograms.

Short Answer

In weight_kg, keep the numeric part with a regex rule and then divide the value by 1000.

How to Do It in Eofferix

  1. Create the final weight_kg column, use the source weight column, and open its settings.
    Opening the weight_kg column settings in the Eofferix table editor
    The settings button is highlighted under the final weight_kg column.
  2. In Transformations, add a rule: condition Regular expression, value \d+(?:[,.]\d+)?, action Remove everything except. This step removes all characters from the string except digits, dots, and commas.
  3. Add the second rule: condition Current valueAny, action Divide, value 1000.
    Rules for extracting the weight number and dividing it by 1000
    In weight_kg settings, the numeric part is kept first and then divided by 1000.
  4. Save the column settings.

Before / After

Before

source data
skuweight_raw
SKU-10011250 g
SKU-1002750 g

After

result
skuweight_kg
SKU-10011.25
SKU-10020.75

Process data faster with Eofferix

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

Sign up