parses + reorders with cardinality file