Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

How to seperate particular text from a column and paste into another column.

Need to find "L0", L1" form column A and paste only the "L0", "L1" into column B.   Thanks..
  • DOLEARY85's avatar
    DOLEARY85
    2 years ago

    but if you need it here's the full code from the query:

     

    let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8sxLy7dS8DFQitWJVgpKTbNScPRxQXB8DJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Added Custom1" = Table.AddColumn(#"Changed Type", "Custom.1", each let
    L0Index = Text.PositionOf([Column1], "L0"),
    L1Index = Text.PositionOf([Column1], "L1"),
    L0 = if L0Index <> -1 then Text.Middle([Column1], L0Index, 2) else null,
    L1 = if L1Index <> -1 then Text.Middle([Column1], L1Index, 2) else null,
    Result = if L0 <> null and L1 <> null then L0 & ", " & L1 else if L0 <> null then L0 else if L1 <> null then L1 else null
    in
    Result)
    in
    #"Added Custom1"

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍