Skip to content

Template yaml file format

Michael Prokopyev edited this page Nov 2, 2023 · 13 revisions

Yaml template file contains following fields:

1. name

Displayable name of template.

Example:

 # Displayable name of template.
 name: "SkyHub external GNSS"

📝 That field is mandatory.

2. code

Code of template.

Example:

 # Code of template.
 code: "magdrone"

Based on this field, a special parser is applied.

  • "magdrone" - mag drone csv parser.
  • "nmea" - nmea csv parser.
  • any other code value - generic csv parser.

📝 That field is mandatory.

3. match-regex

Applies to the first 10 not empty lines of the file to detect template.

Example:

 # Applies to the first 10 not empty lines of the file to detect template.
 match-regex: "^.*RTKPOST-QT ver.+ Emlid b33$"

📝 That field is mandatory.

4. file-type

Type of template for parsing data. Options are CSV and ColumnsFixedWidth.

Example:

 # Type of template for parsing data.
 file-type: CSV

Possible values:

  • CSV - csv file.
  • ColumnsFixedWidth - fixed width columns position file.

📝 That field is mandatory.

5. file-format

Format of data file.

Example of file-type: CSV:

 # Type of template for parsing data. Options are CSV and ColumnsFixedWidth
 file-type: CSV
 file-format:
   # Applies to CSV type. 'true' if file has headers, otherwise false
   has-header: true
   # The symbol which uses to make a comment
   comment-prefix: '#'
   # The symbol used to separate the integer part from the fractional part of a number written in decimal form. Options are ',' and '.'
   decimal-separator: '.'
   # Applies to CSV type. The symbol to separate values from line in CSV file;
   separator: ','

Example of file-type: ColumnsFixedWidth:

 # Type of template for parsing data. Options are CSV and ColumnsFixedWidth
 file-type: ColumnsFixedWidth
 file-format:
   # The symbol which uses to make a comment
   comment-prefix: '%'
   # The symbol used to separate the integer part from the fractional part of a number written in decimal form. Options are ',' and '.'
   decimal-separator: '.'
   # Applies to ColumnsFixedWidth files. The length of every data column to parse information
   column-lengths: [23, 15, 15, 11, 4, 4, 9, 9, 9, 9, 9, 9, 7]

📝 That field is mandatory.

This field is complex and contains the following fields in its composition:

comment-prefix

The symbol which uses to make a comment.

Example

 file-format:
   # The symbol which uses to make a comment.
   comment-prefix: '#'

separator

Applies to CSV type. The symbol to separate values from line in CSV file.

Example

 file-format:
   # Applies to CSV type. The symbol to separate values from line in CSV file.
   separator: ','

decimal-separator

The symbol used to separate the integer part from the fractional part of a number written in decimal form. Options are ',' and '.'

Example

 file-format:
   # The symbol used to separate the integer part from the fractional part of a number written in decimal form. Options are ',' and '.'
   decimal-separator: '.'

has-header

'true' if file has headers, otherwise false.

Example

 file-format:
   # Applies to CSV type. 'true' if file has headers, otherwise false
   has-header: true

column-lengths

Applies to ColumnsFixedWidth files. The length of every data column to parse information.

Example

 file-format:
   # Applies to ColumnsFixedWidth files. The length of every data column to parse information
   column-lengths: [23, 15, 15, 11, 4, 4, 9, 9, 9, 9, 9, 9, 7]

6. data-mapping field

Mapping data from source file to data. Requierd fields (latitude, longitude, trace number, time and date or date-time)

Example of file-type: CSV:

 # Mapping data from source file to data. Requierd fields (latitude, longitude, time and date or date-time)
 data-mapping:
   latitude:
     header: Latitude
   longitude:
     header: Longitude
   altitude:
     header: Altitude
   time:
     header: Time
     format: 'H:mm:ss.fff'
   date:
     header: Date
     format: 'yyyy/MM/dd'
   trace-number:
     header: "zGPR:Trace"

📝 That field is mandatory.

This field is complex and contains the following fields in its composition:

Fields: latitude, longitude, altitude, timestamp, trace-number are fields of the same type, which consists of three fields:

  • header - the name of column with data for CSV file type (file-type: CSV).
  • index - the index of column with data for column fixed width file type (file-type: ColumnsFixedWidth).
  • regex - regular expression for data extraction.

Fields: time, date-time are fields of the same type, which consists of five fields:

  • header - the name of column with data for CSV file type (file-type: CSV).
  • index - the index of column with data for column fixed width file type (file-type: ColumnsFixedWidth).
  • regex - regular expression for data extraction.
  • format - string format of value.
  • type - type of value (Supported values are: UTC and GPST)

Field: date consists of six fields:

  • header - the name of column with data for CSV file type (file-type: CSV).
  • index - the index of column with data for column fixed width file type (file-type: ColumnsFixedWidth).
  • regex - regular expression for data extraction.
  • format - string format of value.
  • type - type of value (Supported values are: UTC and GPST, default valie is UTC)
  • source - source of value (Supported values are: Column and FileName, default value is Column)

latitude

Latitude data source.

Example

data-mapping:
 latitude:
   index: 1

longitude

Longitude data source.

Example

data-mapping:
 longitude:
   header: GNSS:Longitude

altitude

Altitude data source.

Example

data-mapping:
 altitude:
   header: Altitude

timestamp

Timestamp data source.

Example

data-mapping:
 timestamp:
   header: 'Timestamp [ms]'

trace-number

Trace number data source.

Example

data-mapping:
 trace-number:
   header: "GPR:Trace"

time

Time data source.

Example

data-mapping:
 time:
   header: GNSS:Time
   format: 'H:mm:ss.fff'

date-time

DateTime data source.

Example

data-mapping:
 date-time:
   index: 0
   format: 'yyyy MM dd HH:mm:ss.fff'
   type: UTC
   regex: '\d{4} \d{2} \d{2} \d{2}:\d{2}:\d{2}.\d{3}'

date

Date data source.

Example

data-mapping:
 date:
   regex: '\d{4}-\d{2}-\d{2}'
   format: 'yyyy-MM-dd'
   source: FileName

7. skip-lines-to field

First Lines which do not contain any data and have to be skipped.

Example

# First Lines which do not contain any data and have to be skipped
 skip-lines-to:
   # Skip lines until the first matching is found
   match-regex: >-
    ^\s*Timestamp
   # Skip matched line or not;
   skip-matched-line: false

This field is complex and contains the following fields in its composition:

match-regex

Skip lines until the first matching is found.

Example

# First Lines which do not contain any data and have to be skipped
 skip-lines-to:
   # Skip lines until the first matching is found
   match-regex: >-
    ^\s*Timestamp

skip-matched-line

Skip matched line or not.

Example

# First Lines which do not contain any data and have to be skipped
 skip-lines-to:
   # Skip lines until the first matching is found
   # Skip matched line or not;
   skip-matched-line: false