Re: line terminator
- Posted by "Kat" <gertie at visionsix.com> Oct 11, 2004
- 408 views
On 11 Oct 2004, at 9:41, George Walters wrote: > > > What is the normal line terminator for ascii files (dos/win) CR, LF or both? > > I had a bug and found that the last line in the file had no CR, LF but > all the other lines had a CR. I'm wondering if I ported the files > incorrectly from brand x operating system. (Theos OS). I have found it is best to always check every file you read (unless you wrote it in an Eu program) for which combination of line terminators. A text editor may save it one way, a browser another way, any webpage may be backwards, the OSs are different, the option of the ftp downloader may change the file, etc etc. I never parse on \n anymore, i always parse on {10,13} now. Also, when you use Eu to open a file for reads or writes, save yourself some grief and use the "b"(inary) option. Kat