The transition from diffusion to blow-up for a nonlinear Schrodinger equation in dimension 1