Solved

Convert Email Data from Web Form to a delimited file or Excel / Access file

Posted on 2004-08-09
19
196 Views
Last Modified: 2013-12-25
Can anyone help?
I need to Convert Email Data from Web Form into a delimited file or Excel / Access file so that I can then easily import the data into a spreadsheet or database.

Can anyone help?

I am using a mac, using Dreamweaver to build my form and the cgi script "formmail" - although if I need to use ASP I think I could manage this.
0
Comment
Question by:sandpetra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +2
19 Comments
 
LVL 9

Accepted Solution

by:
dutchfoxer earned 250 total points
ID: 11753602
Here is a simple script that will write the results from a form to a delimited file.... it has no extra options, just simple conversion of what comes in -> output this to file:

Create a file called saveform.cgi   and put the following text in it:

#!/usr/local/bin/perl
use CGI;
CGI::ReadParse(*in);
$file = '../tutorial_files/responses.txt';
print "Content-type:text/html\n\n";
print '<HTML><HEAD><TITLE>saveform.cgi results</TITLE></HEAD>';
print '<BODY BGCOLOR="FF0066">';
print '<h2>Thank you for your form submission.</h2>';
print '</BODY></HTML>';
open(FILE, ">>$file")||die "Can't open $file";
flock(FILE, 2)||die "Can't lock $file";
foreach $i (keys %in) {
       print FILE "$in{$i}\t";
}
print FILE "\n";
close(FILE) || die "Can't close $file";


Then do this:
chmod 755 cgi-bin/saveform.cgi


------------
Or download an existing Form script that has the feature of saving files (CSV) in it!
Example of one: http://www.ezscripting.co.uk/csvwrite/

Instead of Perl CGI you could maybe also use PHP for processing the form;
http://www.arecaweb.com/php/newmmex/index.php

nb: With ASP it is also possible. Better you put your question in the ASP area in this case.
0
 
LVL 6

Expert Comment

by:nitinsawhney
ID: 11796732
Could you please throw some more light on your requirement.
Is that there is a form and u need all its fields to be saved as a csv file so that it opens within a spreadsheet.
0
 

Author Comment

by:sandpetra
ID: 11807781
Yes - I think that is all I require.
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 250 total points
ID: 11807974
# assuming perl:

use CGI;
my $q = new CGI;
print join(",",grep(($_=$q->param($_)),$q->param()));

keep in mind that you data should not contain , itself
0
 
LVL 9

Expert Comment

by:dutchfoxer
ID: 12064665
Dont want to be fuzzy, but  nitinsawhney {http:#11796732}  did not give any answer whatsoever, he asked a question  instead. So no points for him I would assume.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 12065539
Cc dutchfoxer
0
 
LVL 9

Expert Comment

by:dutchfoxer
ID: 12107788
LOL what is this? I better post "can u shed some light" in many many questions.... you never know, you might end up with points anyway   :)
0
 
LVL 6

Expert Comment

by:nitinsawhney
ID: 12111275
Any way to re-distribute the points...
I don't think so i should be awarded these points.

Cheers!!
Nitin
0
 
LVL 9

Expert Comment

by:dutchfoxer
ID: 12111500
thats fair of you  nitinsawhney   , but enjoy the points, it is just points and not money

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12118310
Well... If this needs fixing up, that is what PEs do, so just let me know how think it should be and I will do thy bidding. :^)

It looks like it should be :

Split: dutchfoxer {http:#11753602} & ahoffmann {http:#11807974}

Correct?

COBOLdinosaur
Page Editor, CGI
0
 
LVL 9

Expert Comment

by:dutchfoxer
ID: 12120711
COBOL,

yes correct.
thanks for all the work and the effort!
0
 

Author Comment

by:sandpetra
ID: 12120789
Hi There

Sorry i havent awarded points for my question -- family probs meant I was out of action for a while....I didnt realise it would generate this controversy. I am looking at the solution now.. I will make sure I reply to questions I post in the future...sorry!

Thanks again.
0
 
LVL 6

Expert Comment

by:nitinsawhney
ID: 12124689
COBOLdinosaur,
Thanks for all your time and effort.
Hope this time justice is done with awarding points... ;-) ... lol...

Cheers!!
Nitin
0

Featured Post

DevOps Toolchain Recommendations

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AWK How to eradicate Windows carriage returns from 52 files now on unix/mac? 4 40
Convert .csv to tab delimited text 11 82
troubleshoot a python script 8 114
Notepad++ Question 11 28
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

739 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