Page 1 of 1

format string

Posted: Fri May 19, 2006 9:02 pm
by sainath
hi
thanks for reply.
But in my input column is like 1234 | 2345| 234 |......
and i want my o/p as (pre 123) (pre 2345) (pre 234) ......

i think first i have to count for delimitors then can you tell me how to use feild function.
thks
have a feild xxxxx!yyyyyy .I want to format this string to
(pre xxxxx) (pre yyyy) as output.where ! is my delimitor.
pl share your thoughts.

Posted: Fri May 19, 2006 9:35 pm
by kcbland
To change a text string to another, use CHANGE or EREPLACE. Example:

Code: Select all

text_string=CHANGE(text_string, "|", ")(")
To add the leading and trailing parenthesis, just append:

Code: Select all

text_string="(":text_string:")"
To add the "pre" text, just replace the "(" with "(pre"

Code: Select all

text_string=CHANGE(text_string,"(", "(pre")
To do it all at once in a single line:

Code: Select all

text_string=CHANGE("(":CHANGE(text_string, "|", ")("):")","(", "(pre")

Posted: Sat May 20, 2006 2:22 am
by ray.wurlod

Code: Select all

Convert(@FM, " ", Cats(Cats(Reuse("(pre "), Convert("|", @FM, InLink.TheString)), Reuse(")"))

Re: format string

Posted: Sat May 20, 2006 6:42 am
by chulett
sainath wrote:hi
thanks for reply.
But...
:idea: Just a thought, but if you are going to start off a new thread with 'thanks for the reply, but' you really should reply in the original thread - not start a new one. Then people know what started it all, what you are talking about and can bring it to its rightful conclusion.