EBS: Contact Upload Error Code: 'Your file either contains line breaks or the number of columns does not match the number of headers'

Error

Contact Record Status:

Not loaded - critical error

Error Message:

Your file either contains line breaks or the number of columns does not match the number of headers. Remove line breaks in cells and make sure columns align with headers: :{Line in the CSV that caused the error}

line breal.png

Contact upload failure error messages may be viewed under Contacts > Uploads> User-added image.  Selecting the User-added imageupload results icon next to the desired file opens the Upload Results page, where the error is displayed.

Root Cause

This error can occur for a few different reasons that will be explained with examples. The {Line in the CSV that caused the error} portion of the error message will show you the contact or row that caused the error. 

  • Line Break - This error can be caused by a line break in a contact row in the CSV upload file. The line break may be caused by an unintentional line feed, carriage return, or Enter keypress within the contact row. 
  • Backslash- A backslash " \ " at the end of a value in the CSV upload file.
  • Empty Value - An empty value or cell at the end of a row in the CSV. This is expressed as a comma after the last value in a row. 
  • Comma in Value - A value in the CSV file that contains a comma and has no quotes around the value. 

Solution

See the solutions below for each of the separate root causes for the error.

Line Break

Ensure that each contact in the upload file does not contain line breaks or Enter keypresses within the contact row, as the CSV may appear in Microsoft Excel as though there is an extra space or Enter keypress after a value, such as in the First Name column.

line breal.png

The upload file also may appear with the contact split into two separate lines.

CSV With Line Break in Value 2

Opening the CSV upload file in a text editor makes the line break characters visible. There may be an LF (line feed), CR (carriage return), or CR and LF character after the value in the First Name column.

 CSV file in Notepad ++       CSV file in Notepad ++  

A corrected upload file does not contain the extra space or Enter keypress.

CSV Fixed in Excel

When the corrected file is opened in a text editor, the line break characters no longer appear within the contact row. 

CSV Fixed in Notepad++

Backslash

Make sure that the CSV upload file does not contain values that end in a backslash "\". The error identifies the contact with the issue, but it does not identify the specific value that ends with the backslash.  

line breal.png

A corrected CSV upload file with the backslash removed does not cause the error.

CSV Backslash Fixed

Empty Value

Ensure that there are no blank values or cells at the end of rows in the CSV upload file. This blank value is caused by an extra comma at the end of a row in the file.

Having an empty cell or value at the end of a row can be difficult to identify. 

Empty Cells Excel

Opening and examining the CSV upload file using a text editor will allow for troubleshooting. 

line breal.png

There should never be a comma after the last value in a row. For example, if the last value in the row is END, a comma after END creates an empty value.

To fix this issue, open the file in Excel and save it again. Saving the file in Excel typically removes these extraneous commas. If the issue persists, remove the trailing commas manually in a text editor.

Empty Cells Notepad Fixed

Comma in Value

If a value in a CSV upload file contains a comma, that value must have quotes around it to prevent the data from shifting columns and causing an error. For example, if an Additional Information value contains a comma but is not enclosed in quotes, opening the file in a basic text editor shows that there are no quotes around the value "San Francisco, CA".

line breal.png

If the same CSV file is opened in Microsoft Excel, the contact row appears shifted one extra cell to the right and is longer than the header row.

line breal.png

To fix this CSV upload file and prevent the error, the file must include quotes around "San Francisco, CA".

line breal.png

Comma in Value - Excel - Fixed

 

Was this article helpful?
0 out of 0 found this helpful