Donald Trump said on Wednesday he would sign an executive order to keep families together, ending his policy of separating children from their parents at the southern border amid extraordinary public condemnation.