Xref: utzoo comp.unix.questions:22437 comp.sys.ibm.pc:51251 comp.editors:1567 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!rice!uw-beaver!sumax!quick!thebes!campbell From: campbell@Thalatta.COM (Bill Campbell) Newsgroups: comp.unix.questions,comp.sys.ibm.pc,comp.editors Subject: Re: converting PC text files to UNIX WordPerfect Keywords: Word Perfect, text files Message-ID: <4255@thebes.Thalatta.COM> Date: 25 May 90 19:04:33 GMT References: <21463@boulder.Colorado.EDU> Reply-To: campbell@Thalatta.COM (Bill Campbell) Distribution: usa Organization: Thalatta Corporation, Bellevue WA Lines: 35 In article <21463@boulder.Colorado.EDU> baileyc@tramp.Colorado.EDU (BAILEY CHRISTOPHER R) writes: >Help, I need to transfer some text/ASCII files generated by a program on >an IBM AT to our UNIX system, and then edit the files from the UNIX system >with Word Perfect 4.2 for UNIX. Everything was fine until we started >[deleted] >So, I need to know what to do in Word Perfect, or I need a wild card expander >for DOS and UNIX (I process about 40 files each time we do this, so I cna't >sit there and type DOS2UNIX dosfile > unixfile, etc. >Thanks! >. The only difference I have ever seen between text files on dos and unix is the the dos files lines all end in \r\n (carriage return, line feed) and unix files don't have the carriage return. A very simple program to do this would be: (written as I reply) : # remove carriage returns from dos files creating unix equivalents # USAGE dostounix dosfile unixfile # (dosfile and unixfile may be empty in which case this is a simple filter sed 's/^M$//' $1 > $2 exit $? #end of program The ^M is an actual carriage return (CTRL-M) since not all versions of sed will recognize the \r sequence. To enter this with the vi editor press , the CTRL-V tells vi to take the next character literally. -- ....microsoft--\ Bill Campbell; Celestial Software ...uw-entropy----!thebes!camco!bill 6641 East Mercer Way ....fluke------/ Mercer Island, Wa 98040 ....hplsla----/ (206) 232-4164