Train data formatter