[comp.text.tex] need better merge

rom@xor.eng.sun.com (Circuit Group) (09/21/90)

Hi --- this is the first time I'm using this program to post news, 
hopefully nothing will explode.

I'm using merge 

%%	  MERGE -- A Form Letter Option to the LaTeX Letter Style
%%			Graeme McKinstry
%%		graeme%otago.ac.nz@relay.cs.net
%% A version of these macros appeared in TUGboat 8 #1, April 1987.
   ...
%%	6 September 1988
%%	G. McKinstry
%%	-- enhanced the macros to handle running headlines properly;
%%	-- fixed some other problems from the original version not addressed
%%	   fully by C. Roberson;
%%	-- submitted new file to the latex-style archives.
%%

and it works great, but now I want more.  What I want to do
is have a database (flat ascii file) with the names and addresses 
of several people.

Then I want to be able to type a letter into a .tex file and have the 
letter addressed to the people I select in the letter.  An example follows:

database contains:

Jane Brown   705 Charles St.   Champaign IL 60450  jane
Audra Graham PB 112            Bloomsberg PA 02881 audra
Honorable Pat Schroeder 1234 Hart Office Bldg Washington DC 12345 pat

or some such creation

and the file.tex contains:
-------------------------------------------------
\documentstyle[merge]{letter}
\address{my address\\CA 95035}
\signature{A Bhamidipaty}

\begin{document}
\begin{merge}{name_of_database_file}{pat}

\closing{ Thank you,}
\end{merge}
--------------------------------------------------

where pat or jane or audra is used as some short keyword to index
into the database.

So, has anyone written something like this?  I could probably
modify the merge macros, but I'd rather not reinvent it if
someone has already written it.

-Ram

BTW, I've just started following this newsgroup, so if you point
me to some archive of tugboat or some thing like it please give
me instructions on how to get the stuff.

Thanks for any help.

--
-Rom
rom@xor.sun.com