The single most seen message by users is probably the "Incorrect column count".
What does it actually mean?
The incorrect column count means that the columns CSV Improved has found in your file is not the same as the columns in your configuration. Let's clarify this with some examples.
Example 1, incorrect delimiters:
The CSV file looks like this:
"product_sku","poduct_name","category_path"
The template has delimiters set to:
Field delimiter: ^
Text delimiter: ~
Having incorrect delimiters makes it impossible for CSV Improved to read your file. As CSV Improved looks for the ^ character but it cannot find one, it will read the complete line as a single field. This cannot be identified as a supported field and as a result it gives the error message. Always make sure the delimiters match.
Example 2, the trailing field delimiter:
The CSV file looks like this:
product_sku,poduct_name,category_path
PROD1,Product 1,Products/Software,
The field delimiter used is a comma, this means we have a total of 3 fields:
- product_sku
- product_name
- category_path
The product information we want to import has a total of 4 fields:
- PROD1
- Product 1
- Products/Software
Now we can clearly see that there is an incorrect column count because 3 is not the same as 4. Why are there 4 fields for the product information? As we use the comma as field delimiter, after every comma a new field starts. So the comma after Products/Software also creates a new field. The trailing comma must be removed. Always check your file for trailing field delimiters.
Example 3, the duplicate fields:
The CSV file looks like this:
product_sku,poduct_name,product_name,category_path
PROD1,Product 1,Product 1,Products/Software
The field delimiter used is a comma, this means we have a total of 3 fields:
- product_sku
- product_name
- category_path
The product information we want to import has a total of 4 fields:
- PROD1
- Product 1
- Product 1
- Products/Software
Since the product_name field already exists already the same name again is ignored. This leaves you with 3 fields to import while the data contains 4. Either rename or remove the column to solve the issue.
Example 4, the missing field:
The CSV file looks like this:
product_sku,product_name,category_path,product_publish
PROD1,Product 1,Products/Software
The field delimiter used is a comma, this means we have a total of 4 fields:
- product_sku
- product_name
- category_path
- product_publish
The product information we want to import has a total of 3 fields:
- PROD1
- Product 1
- Products/Software
Here we have a situation where the configuration fields are more than the data fields. What happens is that in a spreadsheet program like Excel a cell is not exported until it is "touched". In this case the column header product_publish was added but no value was put in for the product. To solve this the cell must be given a space or anything actually so it becomes a used cell after that it will be exported.
Example 5, the wrong number of fields:
It is possible to use the column headers in a file to tell CSV Improved what fields you want to use. There is another way and that is to assign fields to the template used for import via the templates menu.
The CSV file looks like this:
PROD1,Product 1,Products/Software
The template fields assignment looks like:
product_sku
product_name
attribute
category_path
This means we have a total of 4 fields:
- product_sku
- product_name
- attribute
- category_path
The product information we want to import has a total of 3 fields:
- PROD1
- Product 1
- Products/Software
This is another situation where the configuration fields are more than the data fields. The solution here is to remove the assigned fields that are not being used.