On 11/9/11 09:36 , Ed Gronenschild wrote:
Hi Rudolph,
I used TextEdit. On a Mac with OS version earlier than OS10.6 this problem didn't occur. With TextEdit it is not possible to save as UNIX format. Thanks for the trick to use sed.
Ed
I'm not a great fan of the built in 'TextEdit'. That having been said, did you check under its preferences and make sure that it is setup as 'plain text' and not 'rich text'? I just tested on my TextEdit (Lion, 10.7.2) and it saved in <lf> and not <cr> convention.
You might try 'aquamacs' on the Mac... assuming you're an emacs-ish type person. It works reasonably well. Another editor is "TextWrangler" (available in the Mac OSX App Store for free). If you look in its preferences, under "Text Files" there is an explicit option to save as "Classic Mac, UNIX, or Windows". The default is "UNIX".
Oh, and make sure that the 's/x0d/x0a/' are enclosed in single quotes. I see that my copy-paste in the earlier email somehow lost the quotes. If you have a file called "file1.txt" and want to do the <cr>/<lf> sub and save to "file2.txt", the exact command is
sed 's/0xd/xoa/' file1.txt > file2.txt
HTH