Thank you for help. That did the trick. However, I seem to have found a problem. Since the results file will be used to load a database the "^M" cannot appear in the file.
instead of getting:
"this that the-other-thing^MHere is the other thing^M"
I need to get:
"this that the-other-thing"
"Here is the other thing"
Can you help with this?
Thanks in advance
These two solutions are replacing tildes with carriage return characters (\r or \x0D). If you want line endings, then you should replace tildes with \n like someone else showed. That will turn into the line ending characters for your platform (CRLF, LF).