+ Start a Discussion

csv files/data loader

Here's a question that's come up for me in conjuction with the sforce data loader: does salesforce require that the field delimiter for a csv file be a comma and a double quote? (",")

I am attempting to import data into the comments (a long text field) in the tasks object. A lot of the data that I'm trying to import into this field has quotation marks in it as part of the data, which is causing it to fail. I could work around this if I could use a different field delimeter that I know doesn't exist in the data, in addition to the comma. For instance, I maybe I could use a ^, so ^,^ would be the delimiter?

Much thanks for any advice.
Right now, a comma or a tab will work to separate the columns. But yes, double quotes are the only characters that encapsulates the field. The reason that we did this was to be consistent with Microsoft Excel. Although this is problemmatic for you because you have multiple line data with double quote inside of the columns. However, not to despair, there are two viable solutions to your problem.

1) This is the easiest solution and the one I would recommend. The parser will treat a " as a character if it is proceeded by a double quote. So if it sees [ " ] it will think its the end of the column, but if it sees [ "" ] then it will treat it as a double quote within the column. Just replace all of your " inside of your columns with "", and make sure the columns are still wrapped with a doube quote.

For instance, this will work

"Lexi","This is some text with a single "" double quote in the middle"

2) Edit the CSVFile.java in the sourceforge project. It should be up and "official" by the end of day. (Note: re-pull the project if you did so previously, Brian) This actually may be a pain, that code is old, and may be up for re-writing anyhow.

Happy Loading.
I tried this out today and it worked great. Thanks for your advice!