Page 1 of 1

How to convert quote into double quote

Posted: Thu Aug 07, 2014 9:58 am
by skp
Hi,

We have requirement that in one of the field we will get double quotes we need to convert each double quote into two double quotes.

Ex:
Input value: raj"esh"ran"ja

Output should be: raj""esh""ran""ja

Is there any possibility to convert single double quote into two double quotes for n number of occurances please.

Thanks,
skp.

Posted: Thu Aug 07, 2014 10:23 am
by qt_ky
Did you try using the EReplace function?

Also if you are writing to a text file, then you could use a Sequential File stage in a Server job or Server Shared Container within a Parallel job. It should do the double quote handling you described.

Posted: Thu Aug 07, 2014 10:41 am
by skp
Hi qt_ky,

Thanks for your quick responce. I am not able to see option Ereplace in transformer and also how sequential file can convert single double quote into two double quotes please explain me.

Thanks,
skp

Posted: Thu Aug 07, 2014 11:02 am
by chulett
EReplace was added to the Parallel world in the 9.1 release, I do believe. So you could use a Server job (is it doing anything that requires PX?) or perhaps use a BASIC Transformer. Or you could find the C++ version called pxEReplace that users put together and posted here, give that one a shot although from what I recall reading it may have some... issues.

Posted: Thu Aug 07, 2014 1:59 pm
by ray.wurlod
Or you could use a loop in a Transformer stage, WHILE Index(InLink.TheField, '"', 1) > 0
Within the loop replace the double quote using substring techniques.
Perhaps make use of the LastRecordInGroup() function to constrain the output.

Posted: Thu Aug 07, 2014 3:08 pm
by ssnegi
Refer to my solution :

viewtopic.php?t=152746

Posted: Mon Aug 11, 2014 4:26 pm
by yugee
you can try my solution explained in the post -
viewtopic.php?t=152903