We demonstrate a fundamental operation for generating complex waveforms in the optical domain - line-by-line pulse shaping control for optical arbitrary waveform generation (O-AWG). Independent manipulation of the spectral amplitude and phase of individual lines from a mode-locked frequency comb, or spectral line-by-line pulse shaping, leads to synthesis of user-specified ultrafast optical waveforms with unprecedented control. Coupled with recent advances in frequency stabilized mode- locked lasers, line-by-line pulse shaping control should have significant impact to fields drawing upon developments in the field of ultrafast science.