Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm pulling data from a sharepoint list and some of the text has extra unwanted characters.
How would I remove "<span aria-hidden="true"></span>" from the string below
<span aria-hidden="true"></span>Lets all work 3 days a week
or
remove everything except "Lets all work 3 days a week" from the string below?
<div class="ExternalClass450FFA875469469B9098549F4A621B80"><p><span aria-hidden="true"></span>Lets all work 3 days a week</p></div>
Unfortunately, I'm not sure this will work. We have hundreds of users and I will not be able install a macro for each one.
Unless I can set it up on the original file and it would work for the users using AJAX in IE.
Hi,
Another solution using qlikview script method (no macro in this method)
temp:
LOAD * INLINE [
Field
<div class="ExternalClass450FFA875469469B9098549F4A621B80"><p><span aria-hidden="true"></span>Lets all work 3 days a week</p></div>
];
Data:
LOAD RecNo() as RecNo, Field Resident temp;
drop table temp;
HtmlTag_Map:
MAPPING LOAD DISTINCT '<' & TextBetween('<' & SubField(Field, '<'),'<','>') & '>' as HtmlTag, '' as Substitute
Resident Data;
JOIN(Data) LOAD RecNo, MapSubstring('HtmlTag_Map', Field) as Field_Cleansed
Resident Data;
For more details, refer
rbecher reply
The below works
EDITTEXT:
Mapping Load * inline [
From,to
>,@{
<,}@
];
LOAD
textbetween(Mapsubstring('EDITTEXT',replace(FIELDIS,'><','_')),'@{','}@') as FieldIS
;
LOAD if(Match(right(Trim(FIELDIS),1),'>')=0,FIELDIS&'<',FIELDIS) as FIELDIS inline [
FIELDIS
<div class="ExternalClass450FFA875469469B9098549F4A621B80"><p><span aria-hidden="true"></span>Lets all work 3 days a week</p></div>
<span aria-hidden="true"></span>Lets all work 3 days a week line 2 test
];
I dont know your column name so hardcoded it. You can use your column name like
= Subfield(Subfield(ows_TO_x002d_BE, '</span>',2), '<')
When you say it is not always the same text, i know it wont be but will that text be between
</Span> ...... </P> always or what are the combination of tags you have to look to pull your text. Can you share some sample data or example html tags. ?
Sorry, I probably should have given you guys more information.
When I load ows_TO_x002d_BE, and load it into a table object I get the following.
I then tried this load TextBetween(ows_TO_x002d_BE, '<p>', '</p>') which resulted in
It works for two of my cells but not the middle one. It sill has the extract character string. I am not sure why the middle row has additional extra characters.
I really appreciate your assistance.
If you try the script exactly the way I have posted, it'll work
Hi Bobby,
Try this Expression,
-->> SubField(SubField(SubField(Field,'</span>',2),'><',1),'<',1)
It Will Produce an Output:
Thank's & Regards,
Sumit Jadhav.