konsama
konsama

Reputation: 347

Trying to extract value in text string for a new column

Here is an example of the ask:

Column 1(data)           Column 2(what the goal is)
lskadjf/5/kdjlj          5
kldjfl/8/lkjd            8
oieurow/10/lksajl        10
sldkjfjl                 (blank)
kjsdflj/dsjjfl           (blank)
lkdjflk/lkj              (blank)

Is there a way to do this?

Upvotes: 2

Views: 124

Answers (1)

Alexis Olson
Alexis Olson

Reputation: 40204

You can use the Text.BetweenDelimiters function.

Text.BetweenDelimiters([Column 1], "/", "/")

The GUI works fine for this. Just put / in both boxes.

Extract Text Between Delimiters


If you want to check that there are exactly two slashes, try this:

if Text.Select([Column1], {"/"}) = "//"
then Text.BetweenDelimiters([Column1], "/", "/")
else null

Upvotes: 1

Related Questions