Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!talcott!maynard!campbell From: campbell@maynard.UUCP (Larry Campbell) Newsgroups: net.unix,net.text Subject: Re: Use of ``vi'' for business office word-processing Message-ID: <352@maynard.UUCP> Date: Tue, 16-Sep-86 22:42:16 EDT Article-I.D.: maynard.352 Posted: Tue Sep 16 22:42:16 1986 Date-Received: Wed, 17-Sep-86 03:25:55 EDT References: <1246@kitty.UUCP> <6902@ki4pv.UUCP> Reply-To: campbell@maynard.UUCP (Larry Campbell) Organization: The Boston Software Works Inc., Maynard, MA Lines: 38 Keywords: nroff form letters mailmerge Summary: using nroff for form letters Xref: mnetor net.unix:5512 net.text:987 In article <6902@ki4pv.UUCP> tanner@ki4pv.UUCP (who else) writes: >The reason that our customers have gone to "lyrix" instead of using >what we use for \fBall\fR of our document preparation is simple: >our customers need to print form letters &c. to their customers. > >There appears to be no easy or clean way to merge data into nroff -- >the data would have to be prepared with extra new-lines, and as for >iterating to print a hundred copies -- looks like it would be hairy. Funny, I whipped off a little shell script to do just that today. Something like this (typed from memory, it was on a different system, so I may have dropped a backslash or a quote somewhere): #!/bin/sh # Run this with the data file (address list, whatever) # as standard input # while 1 do read NAME if [ "$NAME" = "" ]; then exit; fi read ADRRESS read CITY_STATE_ZIP sed >/$NAME/" \ -e "s/<
>/$ADDRESS/" \ -e "s/<>/$CITY_STATE_ZIP/ \ | nroff -ms >/dev/lp done Improving this to handle variable number of lines in an address, salutations, etc. is left as an exercise for the reader. This isn't super fast, but then again nroff is where most of the time is spent anyway. -- Larry Campbell The Boston Software Works, Inc. ARPA: campbell%maynard.uucp@harvard.ARPA 120 Fulton Street, Boston MA 02109 UUCP: {alliant,wjh12}!maynard!campbell (617) 367-6846