Quantcast
Channel: SCN : All Content - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 4013

search and replace a string

$
0
0

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!


Viewing all articles
Browse latest Browse all 4013

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>