5.2.2.2. Rules for template files¶
A template file defines the layout and content for the output CSV/XSLX file generated by the Spreadsheet Generator plugin. The easiest way to create a template file is to use the graphical user interface of the plugin as described in Section 5.2.2. If you want to create a template manually instead, you must comply with the following simple rules.
- A template file is a plain-text file.
- Each line of a template file shall either define a column for the output file or contain a comment. Blank lines are not allowed.
- A column shall be specified as
[Title:]Content
.- The optional
Title
defines the column title that shall be used as header information for the resulting output file. If provided, the title must be separated from theContent
using a single:
colon. Otherwise, a default title will be automatically generated. - The mandatory
Content
defines the value that shall be stored in this column for each record of the output file. The content can be an expression referencing a database column or a static value or a combination of both. Please refer to Section 5.2.2.1 for how to write column expressions.
- The optional
- Comment lines must start with
//
or;
as comment marker. They are ignored during export.
Note
For every city object, its object identifier stored in the GMLID column of the CITYOBJECT table will always be exported as first column of each record in the output file. The name of this first column is always “GMLID”. Thus, there is no need to define your own column for the GMLID value.
The following snippet shows an example template file.
1 2 3 4 5 6 7 8 9 10 | // This is a template file for the export of tabular attribute data. // Lines starting with // or ; are comments and will be ignored. ; Street:ADDRESS/[FIRST]STREET Houseno:ADDRESS/[FIRST]HOUSE_NUMBER City:ADDRESS/[FIRST]CITY Address:ADDRESS/[FIRST]STREET, ADDRESS/[FIRST]HOUSE_NUMBER[EOL]ADDRESS/[FIRST]CITY ; // Investment required for equipping the city object with solar panels Investment:CITYOBJECT_GENERICATTRIB/REALVAL[ATTRNAME = 'SOLAR_SUM_INVEST'] EUR |
When using this sample template file in an export operation, a resulting output file might look like the one illustrated in Fig. 5.3.