• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

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

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
sandpetra
Asked:
sandpetra
  • 5
  • 3
  • 2
  • +2
2 Solutions
 
dutchfoxerCommented:
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
 
nitinsawhneyCommented:
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
 
sandpetraAuthor Commented:
Yes - I think that is all I require.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
ahoffmannCommented:
# 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
 
dutchfoxerCommented:
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
 
ahoffmannCommented:
Cc dutchfoxer
0
 
dutchfoxerCommented:
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
 
nitinsawhneyCommented:
Any way to re-distribute the points...
I don't think so i should be awarded these points.

Cheers!!
Nitin
0
 
dutchfoxerCommented:
thats fair of you  nitinsawhney   , but enjoy the points, it is just points and not money

0
 
COBOLdinosaurCommented:
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
 
dutchfoxerCommented:
COBOL,

yes correct.
thanks for all the work and the effort!
0
 
sandpetraAuthor Commented:
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
 
nitinsawhneyCommented:
COBOLdinosaur,
Thanks for all your time and effort.
Hope this time justice is done with awarding points... ;-) ... lol...

Cheers!!
Nitin
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now