Forum Discussion
Remove text between html tags
- 7 years ago
You could try using PowerQuery Text Between function and use '>' and '</' as the delimiters.
You can also do this in DAX using PATHITEM and SUBSTITUTE.
InnerHTML =
PATHITEM( // Splits the string using delimiter "|", and takes the 2nd item that is a type of Text
SUBSTITUTE( // Output <div class="Whatever"|Staff going to storage training|div>
SUBSTITUTE([Html], ">", "|"), // Output <div class="Whatever"|Staff going to storage training</div>
"</","|"
),
2,
TEXT
)
Hi ianbruckner ,
We can create a calculated column using DAX as well.
Column =
VAR len =
SEARCH ( ">", Table1[Column1],, BLANK () )
VAR len2 =
SEARCH ( "</div>", Table1[Column1],, BLANK () )
RETURN
MID ( Table1[Column1], len + 1, len2 - len - 1 )
Regards,
Frank
Hello. I tried your query it worked partially and i still have below html tags in the content which needs to be removed.
<div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:rgb(0, 0, 0);">communication started with recruitment team section head in order to assign contact person,<br>i asked the BRM to follow up on that as <span style="font-family:Calibri, Arial, Helvetica, sans-serif;background-color:rgb(255, 255, 255);display:inline !important;">recruitment team section head didn't reply to the email yet</span>
The highlighted in green should be the outcome. Kindly help,