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

Problem:

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}

NOTE: Contact Upload file failure error messages may be viewed under Contacts >  Uploads User-added image. Clicking on the User-added image icon next to the desired upload file brings you to 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 the contact row in the CSV upload file.  The line break may have been caused by an unintentional Line Feed, Carriage Return, or 'enter' within the contact's 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:

Please see the solutions below for each of the separate root causes for the error.

Root Cause - Line Break

Please ensure that each contact in your upload file does not contain any line breaks or 'enters' within the contact row. There should only be a Carriage Return and/or Line Feed character at the end of the contact line, never in an individual value or cell of the CSV upload file. Highlighted below is the error message in this example. 

Upload Error in the UI

The following CSV upload file would cause the above error. As viewed in Microsoft Excel, notice what looks like an extra space or 'enter' after the value in the First Name column. 

CSV With Line Break in Value

The upload file also may look like the one below, with the contact split into two different lines. 

CSV With Line Break in Value 2

Opening the CSV upload file in the text editor Notepad++ will allow us to see the line break characters. There may be an LF (line feed), CR (carriage return), or CR & LF character(s) after the value in the First Name column. 

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

The following file shows what a corrected upload file would look like.  The extra space or 'enter' has been removed.

CSV Fixed in Excel

See below same file but opened in Notepad++. We see that the line break characters have been removed. 

CSV Fixed in Notepad++

Root Cause - Backslash

Please make sure your CSV upload file does not have any values that end in a backslash " \ ". The error will show the contact with the issue but not the individual value that has a backslash at the end of it. 

UI Error Backslash

The example CSV upload file shown below would cause the above error. The backslash after the First Name "John" is the cause of the error. 

CSV Backslash

The following image shows a corrected CSV upload file with the backslash removed. This file would not cause the error. 

CSV Backslash Fixed

Root Cause - Empty Value

Please insure that there are no blank values or cells at the end of the rows in your CSV upload file. This blank value is caused by an extra comma at the end of a row in the file.  The error message should direct you to which rows to examine. From the errors below, the rows with John Doe and Jane Doe have an issue. 

Empty Cell UI Error

Having an empty cell or value at the end of a row can be difficult to identify. It is not possible to see this using Microsoft Excel. The CSV upload file below is what generated the errors above, but there does not appear to be anything wrong with the file when viewing it in Excel. 

Empty Cells Excel

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

Empty Cells Notepad

There should never be any commas after the last value in the row. Notice how both contacts in this file have a comma after the last value in the row, in this instance END. To fix this file, these commas will need to be removed. They can either be manually removed in Notepad, or this file can be opened in Excel and then re-saved. The act of re-saving the file in Excel will trim these extraneous commas. Below is how the file should look in Notepad. 

Empty Cells Notepad Fixed

Root Cause - Comma in Value

If a value in a CSV upload file contains a comma, that value must have quotes around it to prevent data from shifting columns and causing an error. In this example, we will use an Additional Information field titled "Office Location" with a value of  "San Francisco, CA"

 
Comma in Value - UI Error

The issue here with the CSV upload file is that our example Additional Information value "San Francisco, CA" does not have quotes around it. If the file is opened in a basic text editor it looks like the below. Notice there are no quotes around "San Francisco, CA".

Comma in Value - Notepad

If this same CSV file is opened in Microsoft Excel it will look like the below. Notice the contact row is shifted an extra cell to the right and is longer than the header row. 

Comma in Value - Excel

To fix this CSV upload file and prevent an error, the file must have quotes around "San Francisco, CA". If a correctly formatted file is opened in Notepad it would look like the below. 

Comma in Value - Notepad - Fixed

Below is this same correctly formatted file opened in Excel. Please notice how the header row and contact row are the same lengths. 

Comma in Value - Excel - Fixed
Was this article helpful?
0 out of 0 found this helpful

Article Feedback


While we can’t respond to you directly, we’d love to know how we can improve the article.

Please sign in to leave a comment.