Xref: utzoo comp.unix.questions:22472 comp.sys.ibm.pc:51398 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!matrix!venkat From: venkat@matrix.UUCP (D Venkatrangan) Newsgroups: comp.unix.questions,comp.sys.ibm.pc Subject: Re: converting PC text files to UNIX WordPerfect Keywords: Word Perfect, text files Message-ID: <154@matrix.UUCP> Date: 28 May 90 19:09:35 GMT References: <21463@boulder.Colorado.EDU> Reply-To: venkat@matrix.UUCP (D Venkatrangan) Distribution: usa Organization: Matrix Computer Systems Inc. Lines: 31 In article <21463@boulder.Colorado.EDU> baileyc@tramp.Colorado.EDU (BAILEY CHRISTOPHER R) writes: >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. In DOS, use the following: for %f in (*.*) do dos2unix dos\%f unix\%f If you want it in a batch file, use %%f for %f. In UNIX (csh), use the following: foreach i (*.*) unix2dos unix/$i dos/$i end Inside vi, use the following key mappings (place these in .vi_init). map #7 :%s/\([^^V^V^M]\)$/\1\^V^V^V^M/^M:%s/^$/\^V^V^V^M/^M map #6 :%s/^V^V^M$//^M The first one will convert a UNIX file into DOS file within vi. The second one will convert DOS to UNIX. All except the first '^' in #7 (after [) is due to control-key combination. --------------------------------------------------------------------------- D. Venkatrangan Matrix Computer Systems, Inc. 7 1/2 Harris Rd, Nashua, NH 03062 suneast!venkat uunet!matrix!venkat (603) 888-7790 ---------------------------------------------------------------------------