Replace Semicola

make

Member
Hi there !

i have the follwoing problem. I give out some data into a csv file.
Sometimes one of the values in the csv contains one or more semicola ";".

Like this " Tust customer ; 121 ; has reached highest Level "

I have to replace all the ";" with a ",".

i tried if lookup(";",customer) > 0 then REPLACE(customer, ";", ",").
But i believe that not ALL Semicola will be replaced, only one or the first ??

Iam shure it is not a great problem, but the problem is, i have no documentation for progress.

Can anyone help me may with an short example ?

Greets

make
 
Make,

depending on exactly how the data is being read in you should have no problems using the REPLACE function.

The following is from the Progress Language Reference.


REPLACE(source-string,from-string,to-string)

source-string

Specifies the base string to make replacements in. the source-string parameter can be any expresssion that evaluates to a string. The REPLACE funstion does not change the value of source-string itself; the function returns the string with replacements.

from-string

Specifies the substring to replace. The from-string parameter can be any expression that evaluates to a string. Each occurrence of from-string within source-string is replaced.

to-string

Specifies the replacement substring. The to-string parameter can be any expression that evaluates to a string. Each occurrence of the from-string is replaced by the to-string.

Hope this helps.
 
Back
Top