Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Handle Double Quotes within a CSV file

Oracle ManiacAug 30 2018 — edited Sep 2 2018

Hi all

I had code that worked fine for all the comma-separated texts and prevented my text from being spanned into different columns

as I was spooling it into a CSV file.

For e.g.

If I had a text  - ABDC,DEFG as a value in column col1, whenever I used to spool it into a csv file, it became

                        2 columns .i.e. ABC and DEFG in my csv file.

I handled that using chr(34) .i.e. " .i.e.  chr(34)||col1||chr(34) and it worked fine until I received a text  having double

quotes in the text. say for e.g.  abc"xy,z. This again spans the value into multiple columns instead of just 1.

Please provide a way if we can handle this so that my code handles both comma and double quotes.

Thanks

This post has been answered by Saubhik on Aug 31 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2018
Added on Aug 30 2018
11 comments
4,643 views