Page 1 of 1

How to remove double quotes ( " )

Posted: Tue Dec 20, 2005 11:52 pm
by suresh.narasimha
Hi
I have Source Sequential File , in one of the field while processing after 11,000 rows it encounters a double quote and throws an error

read_delimited() - invalid quotes, column STEXT = "Introduction to Enterprise Architecture| |TC |"

I need to remove the double quote in the transformer and pass the data.

i have searched in dsxchange regarding this ... but i could not make out.

any suggestion might be a great help .

Thanks in Advance

Posted: Wed Dec 21, 2005 12:05 am
by kcshankar
Hi suresh,
If u want to remove double quote in the Transformer and pass the data,use Ereplace function in the Transformer.

Ereplace (string, substring, replacement [ ,number [ ,begin] ] )


Regards
kcs

Posted: Wed Dec 21, 2005 12:08 am
by Bala R
In the sequential file stage you have option to define your quotes. If you have given single quotes change it to double quotes and request whoever that provides you the files to maintain consistent quote character. I suppose the quotes were provided in the file because of the embedded piping symbol in the string.
HTH.

Posted: Wed Dec 21, 2005 12:16 am
by loveojha2
kcshankar wrote:Hi suresh,
If u want to remove double quote in the Transformer and pass the data,use Ereplace function in the Transformer.

Ereplace (string, substring, replacement [ ,number [ ,begin] ] )


Regards
kcs
What you can do is read a single line of sequential file as one column
in the transformer use Ereplace as

Code: Select all

Ereplace(DSLinkname.columnname,'"',"")
write this to an intermediate Hashed file, from there write it to the original sequential file.

How to remove double quotes ( " )

Posted: Wed Dec 21, 2005 1:26 am
by suresh.narasimha
Hi guys

Thanks for ur suggestions .
But Ereplace i have tried but that was not accepting.

Experts please spend your valuable time

Thanks in advance

Posted: Wed Dec 21, 2005 1:37 am
by ray.wurlod
Please post the message that leads you to your assertion that "it was not accepting". Ereplace is an intrinsic function - it must be accepted by the Expression Editor. Perhaps someone has edited your DSParams file, but let's not leap to conclusions without your next post.

The best solution is to have the originators of the file to do quotes properly.

The next best solution is to change the quote character on your Sequential File stage's format tab. Then process the quotes yourself.

How to remove double quotes ( " )

Posted: Wed Dec 21, 2005 5:51 am
by suresh.narasimha
Hey

i tried like this in the derivation part of transformer

Ereplace(Fieldname,""","")

The above derivation is not accepted

Provide me the solution please .....

Posted: Wed Dec 21, 2005 6:12 am
by ravij
Hi Suresh,

Use this EReplace function.

EReplace(Iconv(Linkname.fieldname,"MCP"),'"', "")

RK

Posted: Wed Dec 21, 2005 6:17 am
by kcshankar
Hi suresh,


Use double quote within single quote(' ')
Ereplace(source.Field001,'"','')


regards
kcs

Posted: Wed Dec 21, 2005 8:33 am
by kduke
Use convert() it is faster than ereplace(). It does not do as much but is very good for this type of thing.