Add weights to groups in both text and excel format