Page 1 of 1

String Replace with Mixed Case

Posted: Wed Sep 30, 2009 9:41 am
by Sreedhar
Hi,

I have a special case where I have to replace a word from a string with a mixed case string in a field, I know before hand what are the words that needs to be replaced with some special words.

I get a list of words from a Reference file as

OCONNELL=OConnell
LADISA=LaDisa
LADOUCEUR=LaDouceur
LADUCA=LaDuca
LADUCER=LaDucer
MCDONALD=McDonald
MCMILLER=McMiller
Etc...


When I get an input from the field as

123 Quality Drive MCDONALD Road CA USA

I should get the out put as

123 Quality Drive McDonald Road CA USA.



Any thoughts ?

Regards,
Shree

Re: String Replace with Mixed Case

Posted: Wed Sep 30, 2009 10:14 am
by robjones
Can there only be one single occurence of a word to be replaced, or could you have for example:

123 OCONNELL Drive MCDONALD Road CA USA

Posted: Wed Sep 30, 2009 12:04 pm
by Sreedhar
There could me more then one occerence. Your example senario may also occer.

Posted: Wed Sep 30, 2009 2:21 pm
by Sainath.Srinivasan
You have quite a few options

1.) Split each row into multiple lines with 2 extra columns - line number, column number. Then use individual search and join them back into one line.
2..) Formatting commands outside datastage with your parameter values (a=b) as referenced file
3.) Load your reference file in any dbms like Oracle and use regular expression string


Or use QualityStage