Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ganeshnr073
Helper I
Helper I

Need to remove certain text from the body of message

Hi,

 

I need help to remove the text which is inside the square brackets along with the braces. I have pasted a sample text message.

 

Need to remove the brakets and the data inside.

 

Thanks !

 

Hello @Ganesh [\"mailto:Ganesh@gmail.com\"],   Good Day😊   As we can see your new email address is updated.   [\"cid:image001.png\"][\"cid:image002.png\"] [\"cid:image003.png"]   Could you please explain in which application you are facing the issue .

1 ACCEPTED SOLUTION

pls try this

[
f = Text.Combine( List.Select(
List.Transform(
Text.Split([Column1],"\r\n"),
(x)=> Text.Trim(x)),
(x)=> x <>""),", "),
to = Text.Combine( List.Select(
List.Transform(
Text.Split(f,"["),
(x)=> if Text.Contains(x,"]") = true then   Text.Trim( Text.AfterDelimiter(x,"]")) else Text.Trim(x)),
(x)=> x <>""),", ")][to]

Screen Capture #1355.png

View solution in original post

4 REPLIES 4
ganeshnr073
Helper I
Helper I

Hi @Ahmedx 

 

Thank you so much for the sloution it worked like a magic.

 

I just have one more last concern

 

Along with the if the message contains \r\ and \n. I have pasted 2 emaples below. I neeed to remove these two from the message body. Can we add something in the same formaula ? instaed of wiriting a new formula

 

Example1 : "There is no data to be processed in the attached termination
report.\r\n\r\n

 

Example2 : "Hi @Ganesh, N R\r\n\r\nWe have released blocked mail. Please check your
inbox\r\nafter a while.\r\n\r\n Hi @SOCTeam,\r\n\r\n Kindly add from ganesh@towma.com\r\nunder safe sender list.\r\n\r\n\r\nNote: Please
select ‘Reply All’ when replying to this email so that an available technician
can respond to the request at the earliest.\r\n\r\n\r\nThanks &

pls try this

[
f = Text.Combine( List.Select(
List.Transform(
Text.Split([Column1],"\r\n"),
(x)=> Text.Trim(x)),
(x)=> x <>""),", "),
to = Text.Combine( List.Select(
List.Transform(
Text.Split(f,"["),
(x)=> if Text.Contains(x,"]") = true then   Text.Trim( Text.AfterDelimiter(x,"]")) else Text.Trim(x)),
(x)=> x <>""),", ")][to]

Screen Capture #1355.png

Thank you so much for the help ! It worked

 

Much appriciated.  Keep up the good work 🙂

Ahmedx
Super User
Super User

pls try this

Text.Combine( List.Select(
List.Transform(
Text.Split([Column1],"["),
(x)=> if Text.Contains(x,"]") = true then   Text.Trim( Text.AfterDelimiter(x,"]")) else Text.Trim(x)),
(x)=> x <>""),", ")

Screen Capture #1353.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.