remove last space of each line.