Export to CSV sorted by ID.