Longitudinal Shaping for Beam-Driven Plasma Wakefield Accelerators