Ruby Script that brings series into a acceptable format