Exports data to cvs or sql files