Often when we import files we run into errors that the file is not being read correctly. Where to start looking for the cause of the issue and how to solve this?
Follow these checkpoints to make sure that you have the basics right.
- Up-to-date Available Fields
The list of available fields should be up-to-date before importing starts. If the field list is not up-to-date the import may fail due to missing fields. To update the list of available fields go to Maintenance -> Available Fields -> Click Update or follow Missing fields in RO CSVI document.
- A clean CSV file
A CSV file should not have any extra characters in any place. A good CSV file may look like this:
A bad CSV file may look like this:
Here the " at the beginning and end of the line are wrong
Here the trailing comma is wrong
The template must use the same delimiters as your file has. The type of delimiters does not matter. To know what delimiters your file uses look at your file with Notepad for example.
Some examples of delimiters are:
Sample Field delimiter Text enclosure "product_sku","product_name" , " ~product_sku~^~product_name~ ^ ~ product_sku|product_name |
Check that you have the delimiters filled in your template settings. RO CSVI needs this to know how to read the CSV file. Alternatively you can use the Automatic delimiter detection.
The file must always be encoded in UTF-8 format. No other encoding is supported. See this Save file as UTF-8 on how to save your file as UTF-8 using Notepad2 or using LibreOffice/OpenOffice. This is important because files imported not in UTF-8 encoding will not import correctly with special characters like ë and sentences will be cut off.
- Field names
Use only fieldnames that are available for the type of import you are doing. To see which fieldnames are available go to RO CSVI ---> Available Fields and filter on the type of import you want to do. It is not possible to use any other name. This means that if your CSV file contains the names sku, price, name that these cannot be used, you have to translate them to RO CSVI fieldnames. Your column names will change like this:
- sku --> product_sku
- price --> product_price
- name --> product_name
- Field data
Make sure the data is properly formatted according to the specifications. Information on the fields can be found in respective tutorials.
- Line endings
It is best to use Unix or Windows line endings. Mac line endings can give issues, by default they are not supported by PHP. If you have Mac line endings, you can select the option I'm Mac in your template, this will tell RO CSVI to try to read Mac line endings.
- Use the RO CSVI Analyzer to check your file for any issues. The CSVI Analyzer is included in RO CSVI and can be found by going to Components -> RO CSVI -> Maintenance -> Analyzer.
- Check the debug information
The debug report shows every step RO CSVI takes when importing the file. See the How to collect debug information on how to get your debug report. Check the debug information for anything that might be going wrong or post it in the forum.
After having checked these checkpoints your import should be running smoothly. Check out also this Does my CSV file look correct tutorial on checking your CSV file.