Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!nosc!crash!mwilson From: mwilson@crash.cts.com (Marc Wilson) Newsgroups: comp.os.cpm Subject: Re: How "hard" is CR-LF Message-ID: <4584@crash.cts.com> Date: 22 Sep 90 16:48:02 GMT References: Organization: San Diego Mesa College, San Diego, CA. Lines: 36 In article josef@nixpbe.UUCP (Moellers) writes: >Hi, >Can somebody tell me how "hard" the CR/LF sequence is built into CP/M? >I'm asking this as I want to read a text-file line by line and need a >definite place to terminate the line. It's not built into CP/M at all. It's just that most terminals and hardcopy drvices of the time required both the CR and the LF to get to the first position on the next line. >UNIX uses a single \n, but with a two character sequence, I'm not sure >if LF is always the last character and the second last character is >always a CR which I can discard. 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. You could always therminate the line at 80 characters or CR, whichever comes first. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Marc Wilson ARPA: ...!crash!mwilson@nosc.mil ...!crash!pnet01!pro-sol!mwilson@nosc.mil UUCP: [ cbosgd | hp-sdd!hplabs | sdcsvax | nosc ]!crash!mwilson INET: mwilson@crash.CTS.COM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Marc Wilson ARPA: ...!crash!mwilson@nosc.mil ...!crash!pnet01!pro-sol!mwilson@nosc.mil UUCP: [ cbosgd | hp-sdd!hplabs | sdcsvax | nosc ]!crash!mwilson INET: mwilson@crash.CTS.COM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~