Sort exported data by id