Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!lll-crg!lll-lcc!well!ptsfa!pttesac!vanam From: vanam@pttesac.UUCP (Marnix van Ammers) Newsgroups: net.micro.amiga Subject: Re: Help with Manx C Message-ID: <255@pttesac.UUCP> Date: Thu, 31-Jul-86 18:52:22 EDT Article-I.D.: pttesac.255 Posted: Thu Jul 31 18:52:22 1986 Date-Received: Sat, 2-Aug-86 09:08:46 EDT References: <805@princeton.UUCP> <557@cbmvax.cbmvax.cbm.UUCP> Reply-To: vanam@pttesac.UUCP (Marnix van Ammers) Distribution: net Organization: Pacific Bell ESAC, San Francisco Lines: 29 In article <557@cbmvax.cbmvax.cbm.UUCP> higgin@cbmvax.UUCP (Paul Higginbottom) writes: >In article <805@princeton.UUCP> chiu@princeton.UUCP (Kenneth Chiu) writes: >> >>1. The z editor doesn't seem to recognize :s/pat/repl/ commands. This is >> quite a disappointment, since I use global substitutions sometimes. > >You're right - it doesn't have a replace command (I use MicroEmacs). I'm used to the standard unix /bin/ed and am just beginning to learn z (and vi too for that matter). I think you can do the equivalent of g/pat/s/pat/repl/ via a macro. I recently found that I had received a bunch of files terminated with CR LF and I wanted to get rid of the CR's. So in z I built a macro (the command for that is ":>"). The macro I built was "$x-$" which would go to the end of the line, delete one character, go up one line and go to the end of the line (I think it's already at the end of the line, but just to be sure ...). After building the macro it is executed once. I was on the last line at the time. So now I did the rest of the lines with "9999v" which repeats the macro up to 9999 times. Wish I had my Manx book with me, but I think you can build a macro which will find a string, then delete that string, and then insert your replacement string. Then you can repeat execution of the macro n times with the v command. Marnix --