function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
aaronbaumanaaronbauman 

LexiLoader: errors on create/update/insert for CSV with newlines or line breaks in a cell

Trying to import from a CSV, which contains records that have line breaks, e.g. for an Address field.

They're properly enclosed in double quotes, but LexiLoader reports an error for each occurence.

 

I must be missing something obvious, but my cursory googling turned up no results.

Is it a bug in LexiLoader? Should I be replacing or escaping newlines somehow?

Any suggestions appreciated.

SuperfellSuperfell

I just inserted this csv without any problems

 

Name,BillingStreet
Foo,"Unit 101,
1 Bar st"
Foo2, BillingSt

 

Are you using v27? do you have "use Bulk API" turned on or off in the settings ?

aaronbaumanaaronbauman

OK, more information for you:

Seems like it's only occuring when a single cell contains MORE than one newline.

 

e.g. Can you try reproducing with the following CSV:

Name,BillingStreet
Foo,"Unit 101,

attn Zee Baz

1 Bar st"
Foo2, BillingSt

 

Thanks for the quick reply

aaronbaumanaaronbauman

Same results with Bulk API enabled as well as disabled.

SuperfellSuperfell

That worked for fine for me as well. How are you generating the CSV file? 

aaronbaumanaaronbauman

OK, actually I can't narrow it down by that criterion after all.

As best i can tell, the commonality is punctuation (other than commas, which are not problematic), or multiple newlines.

2-line strings without punctuation are working as expected.

2-line strings with either period "." or slash "/", or 3+ line strings are throwing errors.

 

Here are some literal examples that i'm having trouble with (some sensitive info redacted):

 

ex 1:

"X Finn St
n/a","Northampton","MA","1060","","Home","3488","X Finn St
n/a","Northampton","MA","1060","","3488","","","","","","","","","","","","","","","","","","","X Finn St
n/a","Northampton","MA","1060"

 

ex 2:

"X Rieman Way
P.O. Box X","Swiftwater","PA","18370","","Home","3280","X Rieman Way
P.O. Box X","Swiftwater","PA","18370","","3280","","","","","","","","","","","","","","","","","","","X Rieman Way
P.O. Box X","Swiftwater","PA","18370"

 

ex 3:

"Temple University
Department of Rehabilitation Sciences
Collaborative on Community Inclusion
1700 N Broad Street
Suite 313","Philadelphia","PA","19122","","Home","347","Temple University
Department of Rehabilitation Sciences
Collaborative on Community Inclusion
1700 N Broad Street
Suite 313","Philadelphia","PA","19122","","347","","","","","","","","","","","","","","","","","","","Temple University
Department of Rehabilitation Sciences
Collaborative on Community Inclusion
1700 N Broad Street
Suite 313","Philadelphia","PA"

 

 

aaronbaumanaaronbauman

I'm generating the CSV from a MySQL export (via Sequel Pro (which is sourced from an import of a 3rd party CRM)).

 

Loading in another text editor (emacs), looks like I have some ill-formed line breaks ("^M") that I'll need to address.

 

sorry for WOB, thanks for your help