Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Remove the date from a text

Hello everyone,
I have a column of 15,000 lines corresponding to folder names.
Some folder names have a date embedded in the name and I'd like to remove it.

This date is of type YYYYMMDD and without "/".

For example :
Column :
20230405_name_file
name_file_20240330
name_file
20220325_name_file
...


Would you know how to remove the date to keep only the name?
Thanks 🙂

  • HI Anonymous 

    In the ticket, you shared the wrong sample data before.
    Please share more sample data to get an accurate answer

5 Replies

  • PijushRoy's avatar
    PijushRoy
    Community Champion


    Please create custom column in Power Query and use below code

     

    = Text.Select([Column],{" ","_","a".."z","A".."Z"})

     

     


    Let me know if that works for you


    If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

    Thanks
    Pijush
    Linkedin

  • Anonymous's avatar
    Anonymous
    Not applicable

    I have an error : 

    "Expression.Error : Désolé... Nous n'avons pas pu convertir une valeur de type Record en type Text.
    Détails :
    Value=
    Type fichier=SuiviHebdo16275_Excedent_20230702
    Type=[Type]"

     

    "Type fichier" is the name of my column.

  • Anonymous's avatar
    Anonymous
    Not applicable

    My column type is like this : 

     

     

    • PijushRoy's avatar
      PijushRoy
      Community Champion

      HI Anonymous 

      In the ticket, you shared the wrong sample data before.
      Please share more sample data to get an accurate answer