Matrixrates: Incorrectly Formatted CSV File
Resolve CSV formatting issues for accurate Matrixrates shipping calculations
Table of Contents
Overview
When you encounter an error while uploading a CSV file, it usually indicates an incorrect number of columns. This guide helps you resolve such issues, ensuring your CSV file is properly formatted for successful use with ShipperHQ.
Symptoms of Incorrect Format
Errors like the following suggest format issues:
Notice: Undefined offset: 16 in /app/code/community/Webshopapps/Productmatrix/Model/Mysql4/Carrier/Productmatrix.php on line 891
This often happens when the CSV file has carriage returns or an extra comma. Such issues are more evident when viewing the file in a plain text editor like Notepad or TextEdit, rather than a spreadsheet editor.
For instance, this line from a Product Matrix CSV has an extra column:
,,,,,,,,,,,,,900,,Next Day,,
Troubleshooting CSV Format Issues
If you see other SQL errors or $0 rates on the frontend, examine your CSV setup closely. To resolve common issues:
- Start Simple: If you're new to the extension, begin with an example CSV to understand its structure.
- Identify the Problem: Focus on the row causing the issue by simplifying your CSV down to the essential problematic part.
- Simplify Filters: Temporarily remove additional filters like price, weight, and country to diagnose the issue more easily.
- Incremental Testing: Gradually reintroduce complexity to your CSV, testing each step to ensure everything works as expected.
Important Notes
When saving your CSV file on a Mac, ensure it is saved in a Windows-compatible format as a comma-separated file. We recommend using Libre Office or Open Office for handling CSV files. Adjust the character set for special characters, such as Chinese, as needed.