[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 233 MHz CPU system - Debian and SO 5.2 question



On Sun, Feb 24, 2002 at 02:26:58AM -0800, ben wrote:
| On Saturday 23 February 2002 06:53 pm, Bob Underwood wrote:
| [snip]
| > >
| > > | Is the Star Office 5.2 address book reliable enough for mail merges, or
| > > | has any other word processor (Applixware?) an address book that can be
| > > | used for mail merges?
[...]
| all that said, it is, indeed, one of the few failings of linux that this 
| need--for a functional, reasonable overhead, and business efficient 
| wordprocessor--has not yet been addressed. if i'm wrong about that, i welcome 
| enlightenment. particularly, the subject of mail merge capability reliant on 
| a database that the application itself can generate and control, seems almost 
| to be in grevious antipathy with the core *nix notion that functionality 
| should always be reduced, where possible, to the discreet employment of 
| individually available processes working in concert to produce the desired 
| effect. 
| 
| and, yet, given the quality of the *nix applications incorporated in any 
| functional linux distibution, it does not seem unreasonable to wonder why we 
| still don't have a composite application that would offer you the security of 
| a viable transition to linux, keeping your mail merge needs in mind. again, 
| if anybody can offer extra enlightenment, come on in. 
|
| tex/latex solutions, however they satisfy the ambitions of their proponents, 
| are not an equivalent solution. willing migrants from m$ hegemony deserve a 
| better offer than to be forced to adjust themselves to a convoluted system of 
| protocols that many of the hardiest advocates of linux find burdensome. 

Is a "mail merge" an operation by which a form letter is filled in
with values from a database?  If so, the reason such an app is not
readily apparent is because it is rather easy to script such a thing.

For example, suppose I have a database :

~~~~~~~~~~~~~~
D Man dman@dman.ddts.net
John Doe jdoe@dman.ddts.net
~~~~~~~~~~~~~~

and a form letter 

~~~~~~~~~~~~~~~
\documentclass[letterpaper,12pt]{letter}

\address{The Company \\
         123 My Address \\
         Rochester, NY  14612}
\signature{The Company}

\begin{document}
\begin{letter}{}

\opening{Dear Sir,}

This letter is to inform you that the email address %(ADDR)s is
associated with the name %(FIRST)s %(LAST)s in our database.

\closing{Cordially Yours,}
\end{letter}
\end{document}
~~~~~~~~~~~~~~~

I can create a script that will generate a customized version of the
letter for each entry in the db :

~~~~~~~~~~~~~~
#!/usr/bin/python2.2

db = file( "the_db.text" , "r" )
letterf = file( "the_letter.tex" , "r" ) 
letter = letterf.read()
letterf.close()

n = 1
for entry in db :
    first , last , email = entry.split( " " )
    thisf = file( "letter_%d.tex" % n , "w" )
    thisf.write( letter % { 'FIRST' : first , 'LAST' : last , 'ADDR' : email } )
    thisf.close()
    n += 1
~~~~~~~~~~~~~~


I'm sure someone more familiar with sh/sed/awk could do it with those
tools.  The point is that with text-based markup like LaTeX or groff
or DocBook, it is quite easy to come up with a tag system of your own
and a script to fill in the fields from a DB of your choosing.  This
could be extended to grab the data from a SQL database or an XML file
or whatever you want.  Certainly this script is not robust -- it
assumes the input is valid.  The UNIX philosophy is to Do One Thing
and Do It Well.  As a user you plug the tools together to get your
work done.  Databases already exist.  Typesetting tools already exist.
Plug them together for yourself.

Perhaps someone should design a general system to perform this task,
but I guess so far no one has found it useful enough to do it or has
found it so trivial it isn't necessary to publish it.  I'm not arguing
that you shouldn't make such a tool, but that the example above should
point you in the right direction.  (oh, yeah, I didn't test it, but it
_should_ work :-)).

-D

-- 

A kindhearted woman gains respect,
but ruthless men gain only wealth.
        Proverbs 11:16



Reply to: