  By using a sum rule approach we investigate the transition between the
hydrodynamic and the collisionless regime of the collective modes in a 1D
harmonically trapped Bose gas. Both the weakly interacting gas and the
Tonks-Girardeau limits are considered. We predict that the excitation of the
dipole compression mode is characterized, in the high temperature collisionless
regime, by a beating signal of two different frequencies ($\omega_z$ and
$3\omega_z$) while, in the high temperature collisional regime, the excitation
consists of a single frequency ($\sqrt{7}\omega_z$). This behaviour differs
from the case of the lowest breathing mode whose excitation consists of a
single frequency ($2\omega_z$) in both regimes. Our predictions for the dipole
compression mode open promising perspectives for the experimental investigation
of collisional effects in 1D configurations.
