Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!yale!mintaka!spdcc!esegue!johnl From: johnl@esegue.segue.boston.ma.us (John R. Levine) Newsgroups: comp.unix.sysv386 Subject: Re: Converting DOS text files Keywords: SCO ODT Message-ID: <1990Oct16.134008.22319@esegue.segue.boston.ma.us> Date: 16 Oct 90 13:40:08 GMT References: <1477@pai.UUCP> Reply-To: johnl@esegue.segue.boston.ma.us (John R. Levine) Organization: I.E.C.C., Cambridge MA 02238 Lines: 23 In article <1477@pai.UUCP> erc@pai.UUCP (Eric Johnson) writes: >The problem is this: when you use a DOS-based copy command to copy a text >file onto your system (from a PC floppy, say), that DOS text file >is full of CR/LFs (instead of the UNIX line feed) and has a trailing >Ctrl-Z. [172 line program follows] Here's a six-line shell script that does the same thing. I call it uncr. #!/bin/sh # Get rid of carriage returns in files # Dedicated to the public domain, do anything with it you want. -jrl for i do echo $i: qfile=`dirname $i`/QQ`basename $i` mv $i $qfile && tr -d \\015\\032 <$qfile >$i && rm $qfile done -- John R. Levine, IECC, POB 349, Cambridge MA 02238, +1 617 864 9650 johnl@esegue.segue.boston.ma.us, {ima|spdcc|world}!esegue!johnl Atlantic City gamblers lose $8200 per minute. -NY Times