Path: utzoo!attcan!uunet!zephyr.ens.tek.com!orca.wv.tek.com!pogo!rickc From: rickc@pogo.WV.TEK.COM (Rick Clements) Newsgroups: comp.os.cpm Subject: Re: How "hard" is CR-LF Keywords: text, utilites, CR, LF Message-ID: <9891@pogo.WV.TEK.COM> Date: 1 Oct 90 18:01:41 GMT References: <4584@crash.cts.com> <1990Sep23.092141.1446@actrix.co.nz> Reply-To: rickc@pogo.WV.TEK.COM (Rick Clements) Organization: Tektronix, Inc., Wilsonville, OR. Lines: 17 In article <1990Sep23.092141.1446@actrix.co.nz> ewen@actrix.co.nz (Ewen McNeill) writes: >In article <4584@crash.cts.com> mwilson@crash.cts.com (Marc Wilson) writes: >> Why don't you just scan for the CR? If you find one, then look >> at the next character. If it's a LF, then throw it away. If it's >> not, you've got a weird file. >IMHO, the best idea is to scan for a LF. If you find a CR, then >ignore it. This means that you can read in text files that were >produced on Unix/Amiga/whatever which only have LFs, directly. The only problem is some system use only CR. (The Macintosh is the one I use most often.) I mentioned to someone else that I like PostScript's mothod the best. It takes CR, LF or CR LF as a single new line character. All three are seen by the program as a single new line. On output new line is converted to CR LF. This works reasonably well on all systems. (There may be extra characters on some systems but no files come in as a single line.) -- Rick Clements (RickC@pogo.WV.TEK.COM)