Magellan DirectRoute 3.0 Bedienungsanleitung Seite 114

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 130
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 113
99
Appendix C. GPSBabel XCSV Style
Files
Introduction
Often it is desirable to add a new file format for "one-off" work (perhaps you want to export something to
a spreadsheet or graphing program) or to read a format that GPSBabel does not yet support. For suitably
simple formats, this can be done by a user with no programming experience by providing a GPSBabel
style file.
For a format to be described by a style file, it must be predictable and generally readable by humant.
Formats with binary or unreadable content are not good fits for this scheme. It should have:
A fixed header at the beginning, if it has any at all. This is called a 'prologue'.
Waypoints that are grouped by fixed separators, often a newline. In style file parlance, this is called a
'record'.
Traits of that waypoint described in that record. In the style files, these are called 'fields' and examples
may include longitude or a name.
Fields that are grouped by fixed separators, often a comma or a tab. In the style files, this is called the
field separator.
A fixed footer at the end, if it has any at all. This is called the 'epilogue'.
Once you have created a style file that describes the file format you have or want, you must tell GPSBa-
bel to use the xcsv format and have the xcsv format use that file. If you created a new style file called
"mystyle.style" and you want to write the waypoints from a GPX file named "mine.gpx" to it, you would
issue a command like:
gpsbabel -i gpx -f mine.gpx -o xcsv,style=mystyle.style -F mine.new
You might then examine mine.new to see if it met your expectations. If not, you could continue to
tweak mystyle.style until it did, rerunning the above command each time. If 'mystyle' is a format
that describes a popular program or is likely to be of use to others, you can then share mystyle.style
with other GPSBabel users. Send it along with a coherent descripton to the GPSBabel-misc mailing list
for consideration to be included in a future version.
Style file overview
The first and foremost important step is understanding how the style file is laid out itself. The format is:
DIRECTIVE<whitespace>VALUE
Where <whitespace> is one or more spaces or tabs. There should be no spaces or tabs at the beginning of
the line; all directives start at the left edge in column zero.
An example style format is shown here:
# Format: MS S&T 2002/2003
# Author: Alex Mottram
Seitenansicht 113
1 2 ... 109 110 111 112 113 114 115 116 117 118 119 ... 129 130

Kommentare zu diesen Handbüchern

Keine Kommentare