This package will help converting data objects to csv and vice versa.
github.com/balajimk/csv-export-import