Sanitize input for csv conversion