Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

deleting multiple spaces

Hi, i need help.

I've red more discussion that tells how to purge strings from character, but i can't solve my problem.

I have a column of stringd that contains multiple white spaces sequentially and not, i need to sobstitute every white spaces with only one space.

Can anybody help me?

For example i have this string: 'AMAT IMPIANTI DI GRAZIELLO S.N.C. .'

and i need to obtain this one 'AMAT IMPIANTI DI GRAZIELLO S.N.C.'

thanks



Thanks

5 Replies
biester
Specialist
Specialist

Ciao Cesare,

I'm afraid there is no built in string manipulation function which can handle this in one step. I would write a macro with a custom function and use it in the script. Another possibility would be a loop in the script using built in functions.

Rgds,
Joachim

SunilChauhan
Champion
Champion

i think this may work fine

replace

(col,' ',' ')





Sunil Chauhan
Not applicable
Author

Thanks Joachim!

I will build a macro that do what i need! Smile

Not applicable
Author

replace(replace(replace(column_name,' ',' '),' ',' '),' ',' ') as data

i use nested replace to get rid of multiple spaces .Its working ,but not a good solution..

Thanks

Not applicable
Author

i remove double spaces with single space and re-iterate with nested with replace functions.its working....