I want to export the selected data from specific columns to the new columns in CSV file for my Magento website.
the current website is using different e-commerce system and I want to export the products data in (Magento compatible) CSV file so I can easily import all the data to Magento
for example:
Old tables / columns:
[old_table_1]
[old_col_pid] (primary), [old_col_1], pold_col_2]
1, abc, xyz
[old_table_2]
[old_col_pid] (primary), [old_col_fid] (foreign), [old_col_3], [old_col_4]
1, 1, 123, 456
New columns in CSV (for Magento):
new_col_1, new_col_2, new_col_3, new_col_4
abc, xyz, 123, 456
Is there any way if I can write a query to match the old columns name to new columns name first and then export the data to the CSV.