SATFORM Examples |
|
Home | SATGUI | SATSHELL | SATFORM | SATFILTER | SATREPORT | SATMYSQL | License | Download | Examples | Contact |
A "Mailshot" letter. The source data for this letter is a colon delimited text file, formatted using an awk script.
This example uses bold/underline/italic attributes. Font style and size. Variable data.
Sample Output |
Example SAT/ML |
Assume a file called mailshot in the $SATHOME/form directory with the following contents:
<body> <font univers> ${title} ${firstname} ${lastname} ${houseno} ${street} ${town} <size 15><b><u>Experience of a lifetime offer</u></b><size 12> Dear ${title} ${lastname}, You have been especially chosen to receive our "Experience of a lifetime offer". You are among just 250,000 of our customers who qualify for the chance to borrow as much money as you like. You simply pay back whatever you can afford, as and when you can afford it!! Just think what you could do with <b>one million dollars</b>. One million not enough? Then think of a bigger number!! Simply contact our office any time, any day, day or night, and ask for as much money as you want. We will <i>never</i> refuse a genuine request. We don't do credit checks, we don't require security. This probably sounds too good to be true. So, try us. Dial 555-5055 and ask for money. Yours, Frank Stapleton (Senior Loans Manager) </body>
Example Variable Data |
Assume a file called salary.dat with the following contents:
MR:JOHN:SMITH:12:HIGH STREET:TOWNSVILLE MISS:MARY:JONES:98:LONG ROAD:TOWNSVILLE MR:FRED PETERS:78:GREEN AVENUE:RIVER CITY
Example Script to Format Data |
Assume the printer to be used is called printer1. The following script will print a "Mailshot" letter for each record in the mailshot.dat file.
nawk ' { print "title\034" $1 print "firstname\034" $2 print "lastname\034" $3 print "houseno\034" $4 print "street\034" $5 print "town\034" $6 print "\f" }' mailshot.dat | satform mailshot | lp -dprinter1 -onobanner