PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: #import - Fixed Field Records[Next]: #import - SQL
\ -> Commands -> #import -> #import - Multi Line Records

#import - Multi Line Records

This type of #Import has clearly defined fields which you label. You would frequently wish to display these in a table (say in a HTML page) however nothing says that you need to do so.

Field Information Parameters

On these types of imports "FieldInfo" follows the "DefineName" parameter on the #import command line.

For each field you have defined in your database you must specify field information. The field information is of the format:

{*,FieldName[,FieldOptions]}TitleText

In place of the '*' you could specify the column number you wish to place the field but its usually easier to simply reorder the fields.

The "field name" specifies the name you use in your database. It can contain virtually any characters but must of course not contain the delimiter character ('=' by default). Like all PPWIZARD names the name can contain international characters.

You can optionally specify some field options which vary the way individual fields are processed. Each field option is separated by a comma, valid options are:

The "title text" specifies the value for the field in the header record. Since all fields must be defined we use a blank "title" to indicate that we don't require a field and it should be dropped.

DEFINITIONS/OPTIONS

If you can't understand how these options work then I suggest you try using /debug or #debug to watch what variables the import uses etc.

You should also check out an example of importing a file into multiple HTML pages based on the contents of one of the fields.

Example - Multi Line Import

Lets assume you have created a database (called "WEBLINKS.ML") similar to:

;--- First record ------------------------
   Name     :  Dennis
            :  Bareis
   Email    :  dennis@dennisbareis.id.au
   Web Page :  http://dennisbareis.id.au/index.htm
   Comment  :  Really good site!

;--- Second record -----------------------
    Name:  Fredric Bald
 Comment:  This comment contains LT=< & GT=> characters
Web Page:  www.somewhere.com
   Email:  fred@bnz.com

Note that in the above sample data the first "name" field spans two lines to demonstrate line continuation.

Then you can import the data and convert the email and web addresses into hypertext links with:

<HTML><BODY>
#DefineRexx ML_RECORD_FILTER
            Column.2 = "<A HREF='mailto:" || Column.2 || "'>" || Column.2 || "</A>"
            Column.3 = "<A HREF='http://" || Column.3 || "'>" || Column.3 || "</A>"
#DefineRexx
#define ML_DELIMITER      :
#import WEBLINKS.ML ML  "" "{*,Name}Name" "{*,EMail}Email<BR>Address" "{*,Web Page}http://" "{*,Comment}Comment"
</BODY></HTML>

The following code imports the same database but demonstrates field reordering (unusual requirement), field dropping (email address is not required) and requiring all fields to be specified and non-blank:

<HTML><BODY>
#define THIS1_RECORD_FILTER                                                         \
        Column.2 = "<A HREF='http://" || Column.2 || "'>" || Column.2 || "</A>"
#define THIS1_DELIMITER      :
#import WEBLINKS.ML ML  "THIS1"  "{2,Web Page,required,nonblank}http://"  \
                                 "{3,Comment,required,nonblank}Comment"   \
                                 "{1,Name,required,nonblank}Name"         \
                                 "{*,email}"
</BODY></HTML>


email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: #import - Fixed Field Records[Next]: #import - SQL


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Sunday November 05 2017 at 10:00am