Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

M Query replace rich text

Hi everyone,

 

I am new to M so any help kindly appreciated.

 

I am trying to replace a rich text <br/M with a carriage return. I tried this:

 

RemSpace = Text.Replace(Source,"&nbsp"," ") ,
RemCR = Text.Replace(RemSpace,"<br />","#(cr,lf)"),

 

The first one works well but the second doesn't work at all.  Any idea's?

  • Anonymous's avatar
    Anonymous
    7 years ago

    Actually, I got it wrong but thanks anyway..

     

    This worked...

     

    ReplaceHTMLBR= Text.Replace(RemSpace,"<br />","#(lf)#(cr)")

     

    I did not notice a difference between lf and cr or cr and lf. I'm remembering the type writer!

2 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi Anonymous ,

    What about clicking the option Repalce values like below?

    If you still need help, please share your data sample which could reproduce your scenario and your desired output so that we could help further on it.

    Best Regards,

    Cherry

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Actually, I got it wrong but thanks anyway..

       

      This worked...

       

      ReplaceHTMLBR= Text.Replace(RemSpace,"<br />","#(lf)#(cr)")

       

      I did not notice a difference between lf and cr or cr and lf. I'm remembering the type writer!