Make sure that there is a cr before each lf
fixcr
fixcr inserts CR at the end of each line of input where a CR is not already present. It does not insert CR at the end of a partial final line.
addcr(1)