Forum Discussion

Ns-leyton's avatar
Ns-leyton
New Member
2 years ago

String of numbers

Hello everyone,

Is it possible to get this specfic formet of number from this string of number.

All kind of help will be appriciated.

 

3 Replies

  • hello, Ns-leyton 

        finder = Table.AddColumn(
            your_table, 
            "found",
            (x) => 
                [a = Splitter.SplitTextByDelimiter(" ")(x[column_name]),
                b = List.Select(
                    a, 
                    (w) => List.ContainsAll(chars, Text.ToList(w)) and Text.Length(w) = 9
                )][b]{0}?
        )

    this also finds patterns like 12-456789 but you may add more conditions like split by "-" and check if both parts have the same lenght of 4. Hope you've got the idea.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ns-leyton 

    You can create a custom column and input the following code

    =Text.Middle([Column1](your column name),Text.PositionOf([Column1](your column name),"-")-4,9)

    Output

    and you can also refer to the attachment below.

     

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.