Using a text format file to control emailed form output.

Posted on 2004-08-28
Last Modified: 2010-04-06
I have a form with much of the data in a tabular format, and with our previous server we were able to get the data back in tablular form using a format text file to which the main form refered.  The server was changed and the format file is only partially functional.  The feature that went away was that empty fields could be filled with "placeholder" text so that the column of the returned data could be detected.

I have asked this question in a couple of places before and I have  been unable to use the answer because the answers described ways of influencing the output format in the form itself, which I do not want to do, mainly because it seemed I would not have enough control that way.

Our server handles ASP and CGI.

My question is what approach is there that will let me use a separate format file to control the output of a web form, preserving the tabular characteristics where applicable, and allowing for replacement of an empty field with a string token?

Thank you,
John Fistere
Question by:John Fistere

Expert Comment

ID: 11948209

Author Comment

by:John Fistere
ID: 11952310
Thanks, but the reference seems to be discussing how to download data from a server in the desired format.  I wasn't really sure.  What I need is for the form response to be emailed in the desired format.  I think it will help if I show the format file that used to work on a different server:
Name:      [edName]
Address:   [edAddress]
Line2:     [edLine2]
City:      [edCity]
State:     [edState]
ZIP:       [edZip]
Country:   [edCountry]
DayPhone:  [edDayPhone]
EvePhone:  [edEvePhone]
FAX:       [edFax]
EMail:     [edEmail]
DOB:       [edDob]
DiagnosisDate: [edDiagDate]

Chart: Med PSA [edName2] [edName3] [edName4] [edName5] [edName6]

Prostate Volume: [edProstateVolume]
Gleason: [edGleason]
Clinical Stage: [edClinicalStage]
Ploidy: [edPloidy]
Partin: [edPartin]
Narayan: [edNarayan]

Table: PSA [edName2] [edName3] [edName4] [edName5] [edName6]
[edVarDate01] [edVar1_01] [edVar2_01] [edVar3_01] [edVar4_01] [edVar5_01] [edVar6_01]
[edVarDate02] [edVar1_02] [edVar2_02] [edVar3_02] [edVar4_02] [edVar5_02] [edVar6_02]
[edVarDate03] [edVar1_03] [edVar2_03] [edVar3_03] [edVar4_03] [edVar5_03] [edVar6_03]
[edVarDate04] [edVar1_04] [edVar2_04] [edVar3_04] [edVar4_04] [edVar5_04] [edVar6_04]
[edVarDate05] [edVar1_05] [edVar2_05] [edVar3_05] [edVar4_05] [edVar5_05] [edVar6_05]
[edVarDate06] [edVar1_06] [edVar2_06] [edVar3_06] [edVar4_06] [edVar5_06] [edVar6_06]
[edVarDate07] [edVar1_07] [edVar2_07] [edVar3_07] [edVar4_07] [edVar5_07] [edVar6_07]
[edVarDate08] [edVar1_08] [edVar2_08] [edVar3_08] [edVar4_08] [edVar5_08] [edVar6_08]
[edVarDate09] [edVar1_09] [edVar2_09] [edVar3_09] [edVar4_09] [edVar5_09] [edVar6_09]
[edVarDate10] [edVar1_10] [edVar2_10] [edVar3_10] [edVar4_10] [edVar5_10] [edVar6_10]
[edVarDate11] [edVar1_11] [edVar2_11] [edVar3_11] [edVar4_11] [edVar5_11] [edVar6_11]
[edVarDate12] [edVar1_12] [edVar2_12] [edVar3_12] [edVar4_12] [edVar5_12] [edVar6_12]
[edVarDate13] [edVar1_13] [edVar2_13] [edVar3_13] [edVar4_13] [edVar5_13] [edVar6_13]
[edVarDate14] [edVar1_14] [edVar2_14] [edVar3_14] [edVar4_14] [edVar5_14] [edVar6_14]
[edVarDate15] [edVar1_15] [edVar2_15] [edVar3_15] [edVar4_15] [edVar5_15] [edVar6_15]
[edVarDate16] [edVar1_16] [edVar2_16] [edVar3_16] [edVar4_16] [edVar5_16] [edVar6_16]
[edVarDate17] [edVar1_17] [edVar2_17] [edVar3_17] [edVar4_17] [edVar5_17] [edVar6_17]
[edVarDate18] [edVar1_18] [edVar2_18] [edVar3_18] [edVar4_18] [edVar5_18] [edVar6_18]
[edVarDate19] [edVar1_19] [edVar2_19] [edVar3_19] [edVar4_19] [edVar5_19] [edVar6_19]
[edVarDate20] [edVar1_20] [edVar2_20] [edVar3_20] [edVar4_20] [edVar5_20] [edVar6_20]
[edVarDate21] [edVar1_21] [edVar2_21] [edVar3_21] [edVar4_21] [edVar5_21] [edVar6_21]
[edVarDate22] [edVar1_22] [edVar2_22] [edVar3_22] [edVar4_22] [edVar5_22] [edVar6_22]
[edVarDate23] [edVar1_23] [edVar2_23] [edVar3_23] [edVar4_23] [edVar5_23] [edVar6_23]

[edEvDate01] [sfEvTyp01] [edEvName01] [sfResult01]

[edEvDate02] [sfEvTyp02] [edEvName02] [sfResult02]

[edEvDate03] [sfEvTyp03] [edEvName03] [sfResult03]

[edEvDate04] [sfEvTyp04] [edEvName04] [sfResult04]

[edEvDate05] [sfEvTyp05] [edEvName05] [sfResult05]

[edEvDate06] [sfEvTyp06] [edEvName06] [sfResult06]

[edEvDate07] [sfEvTyp07] [edEvName07] [sfResult07]

[edEvDate08] [sfEvTyp08] [edEvName08] [sfResult08]

[edEvDate09] [sfEvTyp09] [edEvName09] [sfResult09]

[edEvDate10] [sfEvTyp10] [edEvName10] [sfResult10]

[edEvDate11] [sfEvTyp11] [edEvName11] [sfResult11]

[edEvDate12] [sfEvTyp12] [edEvName12] [sfResult12]

[edEvDate13] [sfEvTyp13] [edEvName13] [sfResult13]

[edEvDate14] [sfEvTyp14] [edEvName14] [sfResult14]

[edEvDate15] [sfEvTyp15] [edEvName15] [sfResult15]

[edEvDate16] [sfEvTyp16] [edEvName16] [sfResult16]

[edStart01] [edStop01] [edTrtName01] [edTrtDescr01]
[edStart02] [edStop02] [edTrtName02] [edTrtDescr02]
[edStart03] [edStop03] [edTrtName03] [edTrtDescr03]
[edStart04] [edStop04] [edTrtName04] [edTrtDescr04]
[edStart05] [edStop05] [edTrtName05] [edTrtDescr05]
[edStart06] [edStop06] [edTrtName06] [edTrtDescr06]
[edStart07] [edStop07] [edTrtName07] [edTrtDescr07]
[edStart08] [edStop08] [edTrtName08] [edTrtDescr08]
[edStart09] [edStop09] [edTrtName09] [edTrtDescr09]
[edStart10] [edStop10] [edTrtName10] [edTrtDescr10]
[edStart11] [edStop11] [edTrtName11] [edTrtDescr11]
[edStart12] [edStop12] [edTrtName12] [edTrtDescr12]


These fields referred to data items in the main HTML form, of course.  What I  need is some help in getting this format file to function properly with my form.

John Fistere

Author Comment

by:John Fistere
ID: 12204181
I know that there's an Expert out there that knows how to use the "format file" I posted in this thread.  Where are you?

John Fistere
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

LVL 53

Assisted Solution

COBOLdinosaur earned 100 total points
ID: 12390186
I think you ned to start by posting the code you are using to process the form with on the server.  you said the server was changed.  From what to what?  If there is a migration issue, what has the servr vendor been able to tell you.  If thre are incompatibilites from old to new then the scripting may have to be re-written, but there is no way of determining a solution with the infomation given so far.


Assisted Solution

poopall earned 50 total points
ID: 12391403
My suggestion that the form data is displayed and ussing the <form action ="get" etc ect> your enter the data, when the data is submitted to your reserver, the format the data as comma seperated values and write the data to a file, you can then read the data from that file. You will need to ensure that the file names are not repeated else you will overwrite them sa name the file as yyymmddhhmmss.csv

Input Form
<form  action="writecsv.asp"  method="get"> ps. with large amounts of form data you must use the get method,

field1  value
field2 value

<input type ="submit" value="submit">

The next page would process your data  being writecsv.asp

You would use the

f1  =  response("field1")
f2  = response("field2")
xFilename = DatePart("yyyy", now)&DatePart("m", now)&DatePart("d", now)&DatePart("h", now)&DatePart("m", now)&DatePart("s", now)
This should give you a very random file name,,which should'nt repeat it'sself

yourstring = f1&","&f2

Then you would build a string with the values of the variables seperated with a comma say into (yourstring) as above, you would then write these out to a file using something like

This is the example of the code for WRITING to a file.

Set xFSO = CreateObject("Scripting.FileSystemObject")
Set WriteCSV = xFSO.OpenTextFile("C:\Inetpub\wwwroot\myNewFolder\"+xfilename+".csv", 2, True)

LVL 33

Accepted Solution

shalomc earned 350 total points
ID: 12392769
I once had a similar setup in a hosted account.
It is a CGI program called CGIEMAIL from MIT.

I believe that it is intended to run on Unix, but the C source code is available.

Find it here:

Good luck.


Author Comment

by:John Fistere
ID: 12395274
Thank you all for your comments.

COBOLdinosaur, the problem is that I do not have access to the code in the server.  However, I did access the main form and found that it references CSMailto.cgi, and I am now looking into that.  I tried the demos on but I could make them work, so I am waiting for a response from them.

poopall, thanks, bu I am hoping for a solution that requires less programming on my part.

shalomc, thanks for your reference to CGIemail.  I am checking into that, too.

I guess it is the proper procedure to leave questions open until I get an answer that works for me, but not longer than 21 days.  Is that right?

Cheers and thanks so far,
John Fistere
LVL 53

Expert Comment

ID: 12395338
After 21 days it is considered abandoned.

However, long before that it will slips down far enough on the list that no one is looking at it anymore.  If you don't have access to the  server side, the chance of any kinkd of real solution are pretty slim.  The format file is used by the server side script, and without access to it the script their is not much yu acn do to change the way it handles the format file, and any way to determine what changes in the format file will cause the script to give the desitred result.


Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RSS Feeds--IE 13 179
TripAdvisor Widgets on WordPress Websites 10 151
How do the JavaScript &&  !== operators work together? 3 56
site launch date and last modified date 3 93
When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question