One can transform an optical pulse containing higher-order soliton modes and/or radiation modes into a compressed almost ideal single-soliton pulse by passing it through an initial adaptive fiber of suitably chosen length and dispersion. Analytical approximations, in good agreement with numerical simulations, are found for the optimal values of the length and the dispersion of the adaptive fiber. The technique is applied to the case of nonadiabatically amplified soliton pulses, for which the transformation is shown to result in efficiently compressed soliton pulses.