Re: Question concerning REPLACE function

2009-09-17 Thread Grooms, Frederick W
If you think about it, the string % will match your entire string

font face=Helv size=2font face=Helv size=2blockquotepCM - 
Testing/p/blockquote/font/font
%  

   

Without resorting to an external routine to remove the HTML tags you would have 
to use a loop that does something like the following

Find first(use the STRSTR function
Find first(use the STRSTR function
Remove the text found above
If there still exists a  in string go to the top

Ooh...   You could do it in a single filter
Run-If:   $field$ LIKE %%
Action 1 Set Fields$zTempInt1$ =  STRSTR( $field$,  )
Action 2 Set Fields$zTempInt2$ =  STRSTR( $field$, , 
$zTempInt1$ + 1 )
Action 3 Set Fields$field$ = REPLACE( $field$, SUBSTR( 
$field$, $zTempInt1$, $zTempInt2$ ), )
Action 4  Goto Execution Order of this filter

NOTE:  This is typed off the top of my head before I have had my coffee, but it 
should work.

Fred


From: Action Request System discussion list(ARSList) 
[mailto:arsl...@arslist.org] On Behalf Of Brandi Barbour
Sent: Wednesday, September 16, 2009 11:05 PM
To: arslist@ARSLIST.ORG
Subject: Question concerning REPLACE function

All,
I hope someone has an easy solution to this problem.
For example if i have a field that has a value of font face=Helv 
size=2font face=Helv size=2blockquotepCM - 
Testing/p/blockquote/font/font and I need it to just have CM - Testing
I am trying to use a set fields with REPLACE($csc_char_label1$,  %,  )   
However this is not working and returning the whole value.  Anyway to use the 
wildcard with this function?   The reason is that the value changes with 
different html tags and i would like a universal replace to work but maybe it 
will not.
Any help is appreciated.

Thanks,
Brandi
Windows 2003
SQL 2005
ARS 7.0.1 patch 003


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are


Re: Question concerning REPLACE function

2009-09-16 Thread Frank Caruso
Not sure if this will work for you but if the text you are looking for
is always surrounded by the p tags and there is only one set then
the following will extract what is between:

SUBSTR($VALUE$,STRSTR($VALUE$,p)+2,STRSTR($VALUE$,/p)-1)

Other than that you could run a process where you pass the HTML to an
HTML to Text converter of which there are many. Google Convert HTML
to Text.

On Thu, Sep 17, 2009 at 7:04 AM, Brandi Barbour
barbour.bra...@epamail.epa.gov wrote:
 ** All,
 I hope someone has an easy solution to this problem.
 For example if i have a field that has a value of font face=Helv
 size=2font face=Helv size=2blockquotepCM -
 Testing/p/blockquote/font/font and I need it to just have CM -
 Testing
 I am trying to use a set fields with REPLACE($csc_char_label1$,  %,  )
   However this is not working and returning the whole value.  Anyway to use
 the wildcard with this function?   The reason is that the value changes with
 different html tags and i would like a universal replace to work but maybe
 it will not.
 Any help is appreciated.

 Thanks,
 Brandi
 Windows 2003
 SQL 2005
 ARS 7.0.1 patch 003
 ITSM 7.1 _Platinum Sponsor: rmisoluti...@verizon.net ARSlist: Where the
 Answers Are_

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are