General purpose pre to table converter

demo

Read this entire document for the description, usage, features, and installation instructions for use of these programs. The source code is available here, but be warned that development is in progress. Please indicate unoffical and official versions (i.e., versions not released by me and versions released by me) by prefixing a `U' or an 'O' before the version number. I'd appreciate it if you could notify me of any modifications you may make so I can incorporate them into the official version. You, the user, are responsible for everything the program does.


Description

This program takes a preformatted ASCII file and converts it to a table like so. Used as an SSI, it can not only make updating information easy, but the plain ASCII file can also provide a decent alternative to browsers that can't display tables.


Usage

The general purpose pre to table converter supports the following commands and features. For the purposes of this example, the CGI script is assumed to be named pre2table. Literal characters (i.e., characters you should type in as is) are indicated in a fixed-width font. Variable characters are in italics. See the source code of the demo pages for real uses of program.

pre2table?filename
Will format the text in the ASCII filename using the table tags. The default delimeter for fields is assumed to be a space.
pre2table?filename+delim
Will format the text in the ASCII filename using the table tags. The string specified by delim will be used to delimit the fields in filename.

You can also use this as a Server Side Include (SSI) in the following manner:

<!--#exec cmd="path/pre2table filename [delim_string] [SSI]" -->

where SSI is a literal string specifying that the program is being called in that manner.

The preformatted file used to generate the table in the demo is here.


Features

There are no bugs; there are only features.


Installation instructions

To install the program, you need a C compiler. Edit the defines in cgi_defines.h (explained in detail there) and the Makefile appropriately, and type in `make' at the prompt; it should install without a fuss (at least on an Unix system).


Ramdom access || Ram Samudrala || me@ram.org