home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 2
/
crawlyvol2.bin
/
utility
/
misc
/
master
/
batch
/
mail.bat
< prev
next >
Wrap
DOS Batch File
|
1990-03-25
|
945b
|
39 lines
# simple 'mailmerge' with Master V5.6
if "$1" = "" {
beep
rem Usage: $0 letter
quit 1
}
Letter = "$1"
WORDENTITY = "," ;# words are seperated by commas
# structure of the data file
# 1. line contains the names of the variables to be substituted
# all other lines have the respective values at the same position
open data $Letter.dat
getline varnames
rem > $Letter.prn
repeat
# initialisation of the variables for the next letter
getline values data ;# read values
vars = "$varnames" ;# variablenames into vars
foreach var in vars ;# for every variable
nextitem values $var ;# assign next value
endfor
# now we read the letter line by line and print it
open letter $Letter.txt
repeat
getline text
rem $text >> $Letter.prn
until eof letter
close letter
# start the next letter on a new page
rem >> $Letter.prn
until eof data ;# until we have processed all data
close data