|do you need to do it programatically? or just randomly.|
An excellent text editor is out there called "ultraedit" .. download it and you can manipulate text in any way you want.
open up the file and hit Ctrl + R, in the find string, write
and replace it with nothing. it will replace all the return keys to nothing and you ll get them in straight line.