We aim to understand the formation of dense cores by magnetosonic waves in regions where the thermal to magnetic pressure ratio is small. Because of the low-ionisation fraction in molecular clouds, neutral and charged particles are weakly coupled. Ambipolar diffusion then plays an important role in the formation process. A quiescent, uniform plasma is perturbed by a fast-mode wave. Using 2D numerical simulations, we follow the evolution of the fast-mode wave. The simulations are done with a multifluid, adaptive mesh refinement MHD code. Initial perturbations with wavelengths that are 2 orders of magnitude larger than the dissipation length are strongly affected by the ion-neutral drift. Only in situations where there are large variations in the magnetic field corresponding to a highly turbulent gas can fast-mode waves generate dense cores. This means that, in most cores, no substructure can be produced. However, Core D of TMC-1 is an exception to this case. Due to its atypically high ionisation fraction, waves with wavelengths up to 3 orders of magnitude greater than the dissipation length can be present. Such waves are only weakly affected by ambipolar diffusion and can produce dense substructure without large wave-amplitudes. Our results also explain the observed transition from Alfvenic turbulent motion at large scales to subsonic motions at the level of dense cores.