From Mac OS X - Write file with CRLF
Posted: Mon Mar 22, 2010 3:34 am
Good citizens of the Talking Revolution Forum:
Using Mac OS X (10.5.8 PPC), I am trying to write a file with Windows (CRLF) line endings so I can pass it to another program that expects Windows (DOS) line endings. The dictionary says that Revolution automatically translates line endings and writes a file with the line ending that are appropriate for the computer platform; consequently, I find my file always has Mac endings (CR). I see that it is possible to write with a binary option that will avoid the translation but how do I get the LFs into the lines before a binary write operation?
As a work around, I created an AppleScript that tells TextWrangler to load the Mac file (CR) from disk, change the line endings to DOS (CRLF) and then save it. That works but it is a bit of kludge.
I am curious if there is a more direct method to creating a CRLF file.
Thanks in advance,
Bob
Using Mac OS X (10.5.8 PPC), I am trying to write a file with Windows (CRLF) line endings so I can pass it to another program that expects Windows (DOS) line endings. The dictionary says that Revolution automatically translates line endings and writes a file with the line ending that are appropriate for the computer platform; consequently, I find my file always has Mac endings (CR). I see that it is possible to write with a binary option that will avoid the translation but how do I get the LFs into the lines before a binary write operation?
As a work around, I created an AppleScript that tells TextWrangler to load the Mac file (CR) from disk, change the line endings to DOS (CRLF) and then save it. That works but it is a bit of kludge.
I am curious if there is a more direct method to creating a CRLF file.
Thanks in advance,
Bob