[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using a text format file to control emailed form output.

Posted on 2004-08-28
8
Medium Priority
?
217 Views
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
0
Comment
Question by:John Fistere
8 Comments
 
LVL 2

Expert Comment

by:Epistemo
ID: 11948209
0
 
LVL 2

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:
===================================
Identification:
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]

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

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]
[sfDetailTyp01]
[taDetails01]

[edEvDate02] [sfEvTyp02] [edEvName02] [sfResult02]
[sfDetailTyp02]
[taDetails02]

[edEvDate03] [sfEvTyp03] [edEvName03] [sfResult03]
[sfDetailTyp03]
[taDetails03]

[edEvDate04] [sfEvTyp04] [edEvName04] [sfResult04]
[sfDetailTyp04]
[taDetails04]

[edEvDate05] [sfEvTyp05] [edEvName05] [sfResult05]
[sfDetailTyp05]
[taDetails05]

[edEvDate06] [sfEvTyp06] [edEvName06] [sfResult06]
[sfDetailTyp06]
[taDetails06]

[edEvDate07] [sfEvTyp07] [edEvName07] [sfResult07]
[sfDetailTyp07]
[taDetails07]

[edEvDate08] [sfEvTyp08] [edEvName08] [sfResult08]
[sfDetailTyp08]
[taDetails08]

[edEvDate09] [sfEvTyp09] [edEvName09] [sfResult09]
[sfDetailTyp09]
[taDetails09]

[edEvDate10] [sfEvTyp10] [edEvName10] [sfResult10]
[sfDetailTyp10]
[taDetails10]

[edEvDate11] [sfEvTyp11] [edEvName11] [sfResult11]
[sfDetailTyp11]
[taDetails11]

[edEvDate12] [sfEvTyp12] [edEvName12] [sfResult12]
[sfDetailTyp12]
[taDetails12]

[edEvDate13] [sfEvTyp13] [edEvName13] [sfResult13]
[sfDetailTyp13]
[taDetails13]

[edEvDate14] [sfEvTyp14] [edEvName14] [sfResult14]
[sfDetailTyp14]
[taDetails14]

[edEvDate15] [sfEvTyp15] [edEvName15] [sfResult15]
[sfDetailTyp15]
[taDetails15]

[edEvDate16] [sfEvTyp16] [edEvName16] [sfResult16]
[sfDetailTyp16]
[taDetails16]

Treatments:
[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]

Notes:
[taNotes]

End:
===============================
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.

Thanks,
John Fistere
0
 
LVL 2

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?

Cheers,
John Fistere
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 400 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.

Cd&
0
 
LVL 2

Assisted Solution

by:poopall
poopall earned 200 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

etc
<input type ="submit" value="submit">
</form>



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)
WriteCsv.WriteLine(yoursring)
WriteCSV.Close
SET WriteCSV = NOTHING
SET xFSO = NOTHING
%>




0
 
LVL 33

Accepted Solution

by:
shalomc earned 1400 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:
http://web.mit.edu/wwwdev/cgiemail/

Good luck.

0
 
LVL 2

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 Scriptomatic.net 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
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
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.

Cd&
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

834 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