I may be off base here, but aren't you just looking to remove the carriage return on all but the last line of the file? That should be simple enough to do with a join shouldn't it?
Revolution. Today, 3 O'Clock. Meet behind the monkey bars.
I would love to change the world, but they won't give me the source code