The formation of coherent structures, induced by a super-intense plane electromagnetic wave with a sharp rising edge in an ensemble of electrons (electron beam) in vacuum, is considered. The theory describing this process is elaborated. It is shown that the laser pulse can strongly compress the electron beam and also generate fast density modulations (microbunching) in it. Depending on the duration of a laser pulse front, two harmonics can be present simultaneously in longitudinal density modulations of the electron beam-one with laser wavelength and the other with half of the laser wavelength. By changing the form of the laser pulse envelope, one can control the average density of the electron beam (slow density modulation). By varying the laser pulse amplitude and initial length of the electron beam, it is possible to change the number of microbunches in the compressed electron beam, and for certain conditions only one electron bunch can be produced with ultrashort length smaller than the laser wavelength (attosecond length electron beam). The results of the theory are compared with 1D PIC (particle-in-cell) simulations and a good agreement is found.