Skip to Content
0
Former Member
Aug 10, 2015 at 06:07 PM

search and replace a string

1155 Views

Hi

I have a couple of varchar columns with values separated by commas. I would want to remove any spaces around the commas and need to place the independent values in single quotes.

2 objectives

  • need to remove any spaces (one or more) around the comma. Only around the comma and I dont want to replace the spaces otherwise.
  • Need to place the values separated by comma in single quotes

Example

Input

Column A Column B

John Tim , Tom

Dany 112, 118

Jenny In Town

Output

Column A Column B

John 'Tim','Tom'

Dany '112','118'

Jenny In Town

Am using BODS designer version 14.2.2

Cheers!