Use Varien_File_Csv to import and export CSV files


Varien_File_Csv is a library which is used by Magento to manage files on csv format. This is pretty much simple working with csv’s with it.

To read a csv file you can do the following:

 

To write a csv file you can do the following: