Forum Discussion

arthastic's avatar
arthastic
Icon for Advocate I rankAdvocate I
9 years ago
Solved

How to remove nonessential characters such as punctuation, numbers, web addresses

Hi!

Help me please with removing nonessential characters from text column.

I use Replace Values function to remove this characters:

= Table.ReplaceValue(#"Removed Columns1",",","",Replacer.ReplaceText,{"message"})

How to modify this formula to replace several characters in one step. Or is it ony other way to remove special symbols.

 

Regards!

  • MarcelBeug's avatar
    MarcelBeug
    9 years ago

    Greg_Deckler: Text.Trim only removes characters at the start or at the end of a text.

     

    My suggestion would be to convert the text to a list of characters, remove the unwanted characters and return the result back to a text.

     

    = Text.Combine(List.RemoveItems(Text.ToList("M,,,a.r;;;celB.;e.u.;g"),Text.ToList(",.;")))

     

9 Replies

    • MarcelBeug's avatar
      MarcelBeug
      Icon for Community Champion rankCommunity Champion

      Greg_Deckler: Text.Trim only removes characters at the start or at the end of a text.

       

      My suggestion would be to convert the text to a list of characters, remove the unwanted characters and return the result back to a text.

       

      = Text.Combine(List.RemoveItems(Text.ToList("M,,,a.r;;;celB.;e.u.;g"),Text.ToList(",.;")))

       

    • Sean's avatar
      Sean
      Icon for Community Champion rankCommunity Champion

      arthastic

      You can also use the User Interface to

      Trim - Remove leading and trailing whitespaces from each cell in the selected columns!

      Clean - Remove non-printable characters in the selected columns!

       

       

      • MarcelBeug's avatar
        MarcelBeug
        Icon for Community Champion rankCommunity Champion

        Sean I'm afraid you are mixing up "non-essential" with "non-printable".

        This solution will not return "MarcelBeug" from my example. :smileylol: