
GPS-
Ba-
bel
XCSV
Style
Files
104
to map the internal GPSBabel "description" variable to two or more fields on output). For all practical
purposes, IFIELDS and OFIELDS are defined the same way in the style file.
The following per-field options are defined:
• "no_delim_before" is supported on in OFIELD tags to specify that this field should be written without
a field delimiter before it. It's useful for limited field concatenation.
• "absolute" is supported on OFIELD tags for lat and lon to indicate that only absolute values (never
negative) are to be printed.
• "optional" is supported only OFIELD tags and indicates that the field may or may not be available in
the source data. If the field is absent, no trailing field separator is written.
This attribute is most useful when paired with "no_delim_before" as it allows you to concatenate fields
without concern for whether those fields are actually populated or not.
There are several different types of fields that may be defined. Each field consists of three pieces of infor-
mation: the FIELD TYPE, a DEFAULT VALUE, and a PRINTF CONVERSION (for output). In many
cases, not all pieces are used, but all 3 pieces are required. Additionally, an fourth field is supported that
modifies the behaviour of the field being described.
FIELDS should be defined in the style file in the logical order that they appear in the data, from left to
right. This is the order in which they are parsed from input and written to output.
The fields used by the XCSV parser are as follows:
IGNORE
IGNORE fields are, guess what, ignored on input. Internally, IGNORE fields are treated as CHARACTER
data, and as such, require a printf conversion for a character array.
examples:
IFIELD IGNORE,"","%14.14s" # (writes a 14 character blank field)
IFIELD IGNORE,"","%s" # (writes a blank field on output)
CONSTANT
CONSTANT fields are, of course, constant. They are ignored on input, however they write CONSTANT
data on output. As such, they require a DEFAULT VALUE and a printf conversion for a character array.
examples:
IFIELD CONSTANT,"FFFFFF","%s" # (writes "FFFFFF" in the field)
IFIELD CONSTANT,"01/01/70","%s" # (a constant date field)
INDEX
An INDEX field is used ONLY on output. The INDEX constant defines a field that, at output, contains the
sequence number of the waypoint being written, starting at 0. An index is managed internally as an INTE-
GER and requires an INTEGER printf conversion. An INDEX has one special property. The DEFAULT
VALUE of the index is added to the index on each iteration (to allow indexes starting at 1, 100, etc..).
examples:
Kommentare zu diesen Handbüchern