On-demand generation of dark soliton trains in Bose-Einstein condensates