Enclosing Text in Quotes

  • I'm creating a comma separated file.  My problem is text that contains embedded commas and double-quotes.  How the heck do I get delimiters around the text?

  • How are you currently doing this, or is this a new, from scratch construction?

    What is this file going to be input into?  Can you use some other delimiter that is guaranteed to not show up in the text?

    Imbedded commas aren't usually too much of a difficulty, since they usually show up between quotes,  For commas in numeric strings, you might consider stripping the commas out altogether.

    I've seen the replace() function used to substitute """ for " .  But some programs accept the resulting string correctly and some don't. 


    And then again, I might be wrong ...
    David Webb

  • Right now it's a new construct.  The file is a delimited flat file.  The data is coming from a varchar() column and contains commas, double-quotes and most any other special character that has a real use.  Just glancing at this thing in front of me, I think they call it a 'keyboard', I see four characters that probably wouldn't be used ~`^|, but how do I use these as delimiters instead of a comma?  As for using replace(), I never thought of that, but it would work.

    Thanks for the help.

  • I've come accross this problem quite a bit, and I've used 3 upside down question marks as a delimiter "¿¿¿" They've never come up in any of the wierd and wonderful columns I've ever had to import and so do the job quite nicely.

    In answer to your question about how you set the delimiters, this is done on the flat file connection manager.

    On the columns tab of the connection manager editor, there are 2 drop down boxes that allow you to select column and row delimiters.

    However you can also type into these boxes. If you wanted to use the upside down question mark, you hold down the alt button and type 0191. The character map will tell you the combination of keys to use for most characters.

    Kindest Regards,

    Frank Bazan

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply