Dipole excitation, ionization and fragmentation of N2 and CO in the 10-60 eV region