export_csv function