+ Start a Discussion
DodiDodi 

Data loader - loading data with commas

Dear Guru's

 

I have configured some batch processes to load data into SFDC using the dataloader from the command line.....all works well....however, my source file has comma's in the data. Since the data loader reads from a CSV file, how can I configure it to know that the comma is actually part of a data attribute and not the delimiter.

 

Is there a special character I can write to the source file so that a comma is considered part of the record?

 

Thanks

 

 

Best Answer chosen by Admin (Salesforce Developers) 
jhurstjhurst

Dodi,

 

To do this, you have to surround each of your data columns with quotes.  So if I wanted to insert an Account with the Name of "Comma, Name" I would use:

 

 

"Name", "Industry"
"Account, Name", "Electronics"

 

 

This allows the reader to separate the row columns.

 

Hope this helps.

Jay

All Answers

jhurstjhurst

Dodi,

 

To do this, you have to surround each of your data columns with quotes.  So if I wanted to insert an Account with the Name of "Comma, Name" I would use:

 

 

"Name", "Industry"
"Account, Name", "Electronics"

 

 

This allows the reader to separate the row columns.

 

Hope this helps.

Jay

This was selected as the best answer
SAPOCSAPOC

1.copy your entire data that has data separated by commas in excel file.

2. In the menu ,go to Data->text to columns

3.Choose the field type as delimited,click next

4. Cloose delimiter as Comma .You can also preview your data below.

5. Save this file as csv file.

 

Now you can load your data into salesforce using data loader.

 

sfdcfoxsfdcfox

Please take a look at RFC-4180 (Common Format and MIME Type for Comma-Separated Values (CSV) Files here: http://tools.ietf.org/html/rfc4180. Use quotation marks to enclose a field. If there is ambiguity, use double quotes to quote a literal quote:

 

CSV:

""The Master"","Master, The"

 

Data:

"The Master"    Master, The

DodiDodi

Thanks everyone for your responses.

Andrea DalsenoAndrea Dalseno
Use OpenOffice to open the xls file and then export it to CSV so you can select the correct separator and text delimiter
Dave The RaveDave The Rave
Just wanted to add some useful info for anyone reading this post. If you have several colums of text fields in you CSV file with comma's there is a way in Excel to select a whole column and then add "" to the text.

https://lenashore.com/2012/04/how-to-add-quotes-to-your-cells-in-excel-automatically/