Mark,


The Email attachment is easy enough. Once you have the file created, build an 
email action, click to the attachment tab and browse to the file.



As for making the file. TS has added a new function in 6.1 to help make this 
easier: RSEP= and CSEP=.



Basically, you can select your data set from your database so you have an array 
or rows and columns. I’ll use the default variable name resultset for this 
example.



So to output the array as a csv, you would do this:



<@VAR resultset APREFIX=’’ ASUFFIX=’’ RPREFIX=’’ RSUFFIX=’’ RSEP=<@CRLF> 
CPREFIX=<@DQ> CSUFFIX=<@DQ> CSEP=’,’>



That will output the array with a comma for the column delimiter, a CRLF for 
the row delimiter and each cell’s data between double quotes.



Note that your data must not contain a double quote for this to work properly.



This will only work in TeraScript 1.1 or newer.



Robert





From: Bishop Weiss [mailto:[email protected]]
Sent: Wednesday, September 19, 2012 3:48 PM
To: [email protected]
Subject: TeraScript-Talk: Creating a text file and emailing



I have forgotten how to do a query, create a comma delimited file with a return 
at the end, add that to an email and then have the CSV sent automatically via 
email.

What I envision is easy enough. You open a page, enter your email in a field. 
Submit, and it creates the CSV file, adds it as an attachment to an email, 
addresses the email to the email address entered, and off it goes.

If someone would be so kind, Help me understand the methods I need to use to 
get this to happen.

1. How to create a CSV export.
I think I remember something about redefining the table elements so that the 
</td> is a comma instead, or something like that.
And the </TR> as a return of some kind  Char code=""> or something like that.

2. How to attach that to an email? (I may remember that)

Anyway, I do appreciate your help.

  _____

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe terascript-talk" in the body.




----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe terascript-talk" in the body.

Reply via email to