If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Expression to remove characters between specific characters

Started by Tsunami, 02 Feb 2015 02:26:50 PM

Previous topic - Next topic

Tsunami

I have data that comes over with HTML coding:


ex.

<p> Date </p>

How do I get rid of everything that is between <> including <> itself?  The example is super simplified.  The data comes w/ several HTML items.

keshavchhn

For the mentioned example you can use:
substring([Dateitem],4,4)
it will give you Date.

Robl

Try this

replace([yourstring], '<p>', '')
That should replace the <p> tag with a zero length string.
Then do it again for </P>

If there are loads of differen html tags then I'd be looking at doing something with a substring with locate < and locate > to determine which bits to cut out.

CognosPaul

What data source is this? Some databases, like Oracle, have XML functions you can use. You might be able to do:
xmltype([Field]), and then use the extractValue() on that.


Tsunami

Quote from: Robl on 03 Feb 2015 04:54:42 AM
Try this

replace([yourstring], '<p>', '')
That should replace the <p> tag with a zero length string.
Then do it again for </P>

If there are loads of differen html tags then I'd be looking at doing something with a substring with locate < and locate > to determine which bits to cut out.

good idea, think I can modify this to meet my needs...may be tedious but should be able to get it to work

This is a MS SQL datasource.