PPWIZARD Manual
[Bottom][Contents][Search][Prev]: #import - Delimited Records[Next]: #import - Multi Line Records

#import - Fixed Field Records

These type of #Imports have clearly defined fields. You would frequently wish to display these in a table (say in a HTML page) however nothing says that you need to do so. If you wish to create macros and then #include a template file then that is also possible.

The fields have a fixed starting and ending column. The last record does not need to have a fixed ending column and can span to the end of the line. Leading and trailing whitespace is removed.

Field Information Parameters

On these types of imports "FieldInfo" followings the "DefineName" parameter.

For each field that you are interested in you need to define information in the format:

{*,StartingColumn-[EndingColumn]}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 "StartingColumn" specifies the column where the field starts. The optional "EndingColumn" specifies where it ends, if not supplied it ends at the end of the line. The first column in a line is column 1.

The "title text" specifies the value for the field in the header record. If this "title" is blank the field will 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

Assume we have a file as follows (IMPORTME.FIX):

    First Name         Last Name           Job
    Dennis             Bareis              Programmer
    Wendy              Buxton              Librarian
    Fred               Nerk                Idiot
    

We note that it has the following fields:

  1. First Name, starting in column 1 ending at 18
  2. Last Name, starting in column 20 ending at 38
  3. Job, starting in column 40 ending at end of line.

The following line would import the fields in order (into a completely default table layout):

    #import IMPORTME.FIX FIX- '' "{1,1-18}First Name" "{2,20-38}Last Name" "{3,40-}Job"
    


[Top][Contents][Search][Prev]: #import - Delimited Records[Next]: #import - Multi Line Records

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Tuesday January 02 2001 at 7:37am