Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!ucbvax!PUCC.PRINCETON.EDU!MQUINN%UTCVM From: MQUINN%UTCVM@PUCC.PRINCETON.EDU Newsgroups: comp.sys.apple2 Subject: Re: Stripping LF's from files Message-ID: <9011280256.AA27679@apple.com> Date: 28 Nov 90 02:43:49 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 51 On Mon, 26 Nov 90 23:11:21 GMT said: >I download text file from the VAX at UB. However, the Vax uses LF's to >separate lines from each other and automatically inserts the CR when reading. > >When a file is downloaded, it has LF's where the CR's should be. Does anybody >know of a program that is either free or cheap that will replace the LF's with >CR's? Currently I am using a program called SOFTTERM to do this, but SOFTTERM >barely deals with Prodos, and it is a messy proceedure at best. I would like >something in Prodos that I can put on my HD. > >Thank you for your assistance > >Dave I -THINK- that the linefeeds are ASCII code 10 (decimal). If this is the case, here's a short program that'll do it: 5 ONERR GOTO 120 10 D$=CHR$(4) 20 SR$="SOURCE.FILE" 30 DT$="DEST.FILE" 40 ?D$;"OPEN ";SR$ 50 ?D$;"OPEN ";DT$ 60 ?D$;"READ ";SR$ 70 GET A$ 80 IF ASC(A$)= 10 THEN A$=CHR$(13) 90 ?D$;"WRITE ";DT$ 100 ?A$; 110 GOTO 60 120 ?D$;"CLOSE ";SR$ 130 ?D$;"CLOSE ";DT$ This -SHOULD- strip the LF's and replace them with CR's. I have to do this with several files I download from my CMS account, but they're a little different; they have BOTH LF's and CR's, so I just strip the linefeeds off like this: Using previous program, delete lines 70 and 80 and insert a new line 70: 70 INPUT A$ And leave the rest the same. Hope this helps. ---------------------------------------- Michael J. Quinn University of Tennessee at Chattanooga BITNET-- mquinn@utcvm pro-line-- mquinn@pro-gsplus.cts.com