Cleans line breaks in a file with segments. Segments and delimiter are taken as input.