Technical manual CIB jsMerge
Data Supply
CSV
CSV files are one ore several textfiles that contain the names of input fields and the respective values. The Acronym CSV means "comma separated values".
The first
line of the control data file contains the control data record that is made up
of field names, seperated by a ";". The control data record can hold any
amount of field names, only limited by available memory.
Every following line exists of exactly one data record. A data record contains
the templates or data that is to be included in the same order as the field
names, separated by ";". The number of entries in a data record has
to match the number of fieldnames in the control data record.
CIB jsMerge can process a single CSV file or multiple, so called multi-CSV
files.
The property "datafile <datasource>" sets the required CSV file for CIB jsMerge.
Notes about special characters
If a text snippet contains semicolon, tabstop or quotation mark, the whole snippet has to be put in quotation marks. Quotation marks in a text snippet have to be doubled.
Example:
If you want to insert the company name Yachting "Black Pearl" into a template, the entry in the CSV control file has to be in the following form: ; "Yachting ""Black Pearl"""; .
UTF-8 encoded Data-CSVs
The CSV file and the provided data have to be UTF-8 encoded.
Single-CSV-file
Description:
In a single-CSV-file the values are directly associated to the input fields. The user has access to the values directly via the field name in the template.
Syntax |
Example |
Header 1.data record ... n.data record |
Fieldname1;Fieldname2 value11; value12 ... valueN1; valueN2 |
Multi CSV file
Description:
A multi CSV file enables managing several CSV files. It contains the names of all CSV files that should be loaded in the current merge run. Via the fields in the header of the multi CSV file every CSV file is assigned an alias that can be referenced in a document and grants access to a specific CSV file.
Usage with CIB jsMerge:
To use a multi CSV data supply the properties "datafile" - specifiying the multi CSV file - and "multidatafile" have to be set.
Syntax |
Example |
Header with alias name Names of all CSV-files used |
table1; table2 Tab1.csv; Tab2.csv |
|
Syntax |
|
|
Syntax |
|
|
|
Tab1.csv |
|
|
Tab2.csv |
|
|
CSVName1; CSVName2 Value11; Value12 ValueN1; ValueN2 |
|
|
CSVName1; CSVName2 Value11; Value12 ValueN1; ValueN2 |
Advantages to XML:
- Simple format
- Simple 1-n relation
- Smaller filesize