|
form2csv Copyright 2001 - 2005, Stuart Udall
version 1.24: May 15, 2005
|
|
 
FORM2CSV is a webform parsing tool. It can scan any group of files in any directory for a group of fieldnames, and output the contents of those fields to a CSV-formatted file. This is useful for converting the emails that are sent from forms on websites, using scripts such as formmail, to a standard, compact format which can be read by a number of spreadsheet and database applications, such as Microsoft Excel. FORM2CSV runs in batchmode only. FORM2CSV logs all its activity to file. FORM2CSV does not download the messages from your POP server. It expects the emails containing the form data to be saved as individual text files with identical filename extensions - for example, 1.txt, 2.txt, 3.txt. Your email software should be able to do this. If not, I suggest Pegasus Mail. FORM2CSV can actually read Pegasus' mailbox directly, as Pegasus saves its new messages as text files all named as *.CNM. Any messages FORM2CSV finds that match an email address you specify are scanned for the fields you specify; any found field values are saved into a CSV-formatted text file you specify, and then the messages are deleted from the new mail folder by FORM2CSV.
To start FORM2CSV, run FORM2CSV.EXE. FORM2CSV will read FORM2CSV.INI in the current directory, if it exists, and attempt to extract from it the settings required. If the settings cannot be found, FORM2CSV will abort. The required settings are as follows:
The above tells FORM2CSV to process four rules, named feedback, survey, personal, and test, respectively. In addition, each rule must be defined. The format of a rule is as follows: [rulename] emailaddress=some@emailaddress.com targetcsv=d:\user\lsi\feedback.csv field=pickle-firsthear field=pickle-body The above tells FORM2CSV to process any messages addressed to some@emailaddress.com, scanning them for two fields, pickle-firsthear and pickle-body; and output any field contents to the file d:\user\lsi\feedback.csv. The first line of the rule, [rulename], should match with a rule in the rulelist. To exclude a rule from processing, simply remove it from the list; you don't need to delete the rule from the INI file. Multiple rulelists can be used by commenting out all but the desired line in the INI file: rulelist=feedback,survey ;rulelist=feedback,survey,personal ;rulelist=test FORM2CSV will only process a rule if it defines the variables emailaddress (the name of directory containing emails containing form data) and targetcsv (path and filename of database to write to). FORM2CSV supports 200 different rules, and 200 different fields per rule.
Once started, FORM2CSV will execute and exit. Check the logfile to see what happened. There are no configurable runtime options. See configuration and startup for configuration information.
 
 
|