I have a Scenario in report where i have to replace a string.From a HTML page i get a string in the format of STR1 = 'X1' AND 'X2' AND 'X3'
This string needs to be converted in to the format of STR1 = X1 + X2 + X3 removing both the quotes and the AND replaced by a plus sign and add to this the string is always dynamic.Is there any solution for this.This message has been edited. Last edited by: Kerry,
7.6.4 Unix & Windows Excel,HTML,PDF,PPT,AHTML
January 03, 2010, 03:45 PM
FrankDutch
there are many ways to replace characters in a string.
did you look at the several formulas?
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
thanks for the solutions of which most of them almost worked.I am not able to use the STRREP function to replace AND with a '+' Sign.The Error is something like invalid argument in the fucntion.Is this because this being an operator?? and the other problem is with the single quote .How will it recognize the ' and replace it coz -SET &V1 = ' 'a' OR 'b' OR 'c' OR 'd' OR 'e'' ;
-SET &V2 = STRREP(&V1.LENGTH, &V1, 1, ''', 1, ' ', &V1.LENGTH, 'A&V1.LENGTH'); would be an invalid specification
7.6.4 Unix & Windows Excel,HTML,PDF,PPT,AHTML
January 03, 2010, 07:45 PM
Dan Satchell
Try this code. The STRIP function is used to remove the single quotes. STRREP does not like the + sign so I replaced 'AND' with '^', then used CTRAN to replace the '^' with '+'. I used a length of 100, but you should adjust this length to the maximum expected length of your input string. Also be aware that the output length for STRREP must be longer than the input length.
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
January 04, 2010, 05:47 AM
Dan Satchell
quote:
... or boredom!
Tony is closer to the mark. While awaiting the appointed hour to perform my duty as parental chauffeur it came down to a choice between an interesting Focal Point problem and the mindless drivel they call entertainment on the telly.