form2csv

Copyright 2001 - 2005, Stuart Udall

overview
important bits
installation
configuration and startup
controls and methods
issues and limitations
planned improvements
revision history
latest version

version 1.24: May 15, 2005


 
  overview next section top of page

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.


 
  important bits next section top of page

  • requires Windows 9x/ME/NT/2K
  • This program is LICENSED SOFTWARE and may not be copied or distributed without prior written permission of the author.
  • Please see the license agreement included with the software for the complete terms and conditions of use of the software.


 
  installation next section top of page

  1. run the self-extracting distribution archive


 
  configuration and startup next section top of page

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:

  • logfile= the name of the file in which to log activity
  • logverbose= set this to YES to see "(0 parsed)" log entries
  • inboxdir= set this to point at the directory containing the files to process
  • extension= set this to describe the files' extension, such as TXT
  • rulelist= a comma-delimited list of rules to process, as such:
    rulelist=feedback,survey,personal,test
    

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.


 
  controls and methods next section top of page

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.


 
  issues and limitations next section top of page

  • FORM2CSV will not use Long File Names.

 
  planned improvements next section top of page
  • retrieve messages direct from POP server

 
  revision history top of page

February 14, 20010.01initial development
July 18, 20010.02tweaks
September 24, 20010.21bugfixes
September 8, 20020.22improved performance
January 2, 20030.23added Windows NT/2K support
October 6, 20040.24bugfixes
May 15, 20051.24commercial release