Skip to content
Book a demo

Connect documentation

All documentation
Documentation

cutre

On this page

Select and keep specific columns from a data extract using a regular expression.

Introduction

Use the cutre instruction to keep selected columns in a data extract and remove all unselected columns. Use a regular expression to find the columns to keep.

When to use this instruction

Use cutre when:

  • You want to keep columns whose names match a pattern (for example all columns starting with Ad or all containing _id).

  • You are working with many columns and manual selection would be error-prone or time-consuming.

If you only need to specify exact column names, use cut instead.

Creating a custom script transformation using the cutre instruction

To create and configure a custom script using the cutre instruction, follow these steps:

  1. Create a custom script transformation.

  2. In the Instruction step, select the cutre instruction.

  3. To configure the custom script instruction, fill in the following fields. Required fields are marked with an asterisk (*).

Regex*

Enter a regular expression to find the names of the columns to keep. For example, enter the regular expression ^Ad.* to keep columns with names that start with Ad.

Subtable

Enter the name for a subtable that you want to use within this custom script.

A subtable is a temporary table that only exists for this custom script. You can apply additional instructions within the same custom script to the subtable. However, the subtable cannot be used in any other custom scripts.

If a subtable does not exist for the current custom script, the transformation is applied to the data extract, and the enriched data is output into the subtable. If the subtable already exists for the custom script, the subtable is used as the input for the transformation and optionally as the output.

Example

Transformation configuration

Regex

^Ad.*

Data table before transformation

Scroll horizontally to see the full table.

Ad Campaign

Ad Group

Clicks

Date

Brand

In-App

5568

2022-02-11

Ecommerce

In-App

7815

2022-02-11

Growth

Media

6443

2022-02-11

Data table after transformation

Scroll horizontally to see the full table.

Ad Campaign

Ad Group

Brand

In-App

Ecommerce

In-App

Growth

Media