How to Import CSV Without Headers into Magento 2
Need to import products from a non Magento 2 CSV without headers? Normally an exported spreadsheet contains column headers that correspond to database fields and can be easily read by Magento. Thus, if you have the file without column names, most likely you received it from some third-party supplier or exported for different system.
So having a custom CSV is it possible to use standard Magento 2 import tool? Let’s see.
Default Magento Import
The short answer to the above mentioned question is - ‘No’. In Magento 1 there was available DataFlow tool allowing mapping of file columns. In Magento 2 it was completely deprecated. The only default upload function in Magento 2 is ‘Import’ and it cannot parse CSV without column headers.
Magento has predefined array structure with very strict requirements to both content of required columns and the way they are named. So even if all mandatory fields are present in the spreadsheet, without proper headers, the file will not be recognized by the system. When you press ‘Check Data’ during upload, you will receive a dozen of errors indicating that some important data are missing in your CSV.
To ensure that the column headings can be read by Magento 2, first export the data from your store as a CSV file. Then copy headings from exported file to your spreadsheet. This would require some time to search and update your file with necessary column names.
To optimize the work and define the set of minimum fields required for Magento 2 import and check their correct names, refer to this tutorial -https://www.mag-manager.com/product-information/magento-product-management/required-magento-2-import-values/
Import to Magento 2 CSV Without Headers ‘As Is’ Using Store Manager
Looking for any way to do this without changing the CSV manually every time? Store Manager for Magento application includes import function that allows to read and manipulate the data from file with column names different than needed by default or the one not containing any headers at all.
Map CSV w/o Headers to Magento 2 Fields with Store Manager tool!Try FREE
During import simply indicate that the first row does not contain headers. This way values from the first line will be treated as product records, not column names.
Mapping CSV rows to database tables makes it possible to import file of basically any structure. To do so, simply select database table among offered on the left and double-click at row of CSV on the right at this step.
After that you see that unassigned fields that was previously marked in red as not linked, now became black (meaning that now they are mapped). Also next to mapped magento db field appears number of CSV column.
What’s best, even if some data are missing or should be adjusted, there is no need to do it manually before upload. Store Manager app allows to alter information on-the-fly using special expression formulas.
Check the complete Magento 2 import guide with detailed explanation of all upload capabilities Store Manager for Magento offers -https://www.mag-manager.com/useful-articles/magento-product-management/magento-import-products/
Easy Import of Magento 2 CSV Not Containing Column NamesCheck Yourself