On Wed, Jun 06, 2001 at 11:07:25PM +0200, Martin Hansen wrote:
> Is it possible to combine letters with an address database, so that i 
> get ex. 10 letters where only the 'to address' is different?
> I can't find anything in the documentation, about this.
> My lyx version is 1.1.5fix1.
> 

I have done this with a hackish combination of Lyx and perl.

I create a letter template in LyX, putting in things like:

  YYYYY
  ZZZZZ

  Dear XXXXXX,

I format the leter and preview it, making sure I like the result.

Then I export the address database into a flat file (one record per line).

My perl script then reads each line, doing something like:

  my $num = 0;
  while (<INPUT>) {
    <<Create temp_letter by doing the substitutions into the template>>
    system("lyx --export ps temp_letter.lyx");
    $num++;
    rename("temp_letter.ps", "letter_".$num.".lyx");
  }

Afterwards, I just print letter_1.ps, letter_2.ps, etc.

This works because the lyx file is a simple ASCII file.

                        ---Kayvan
-- 
Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)

Reply via email to