Text Selectors
Help Contents
-
Fernhill SCADA
-
Help
-
Concepts
-
Text Selectors
Introduction
Many SCADA applications use data provided in text form. For example:
- A weather report provided in Java Script Object Notation (JSON).
- Energy export prices in Comma Separated Variables (CSV) format.
- A plain text file containing a list of products allowed in a storage silo.
A Text Selector is a way of locating a field or value within a text document.
For example the Text Selector Line(5) returns line number 5 from a plain text document.
Fernhill SCADA uses Text Selectors in these areas:
Text Selector Syntax
A Text Selector uses this syntax:
Read-Transform ::=
{ JSON-Read-Transform | CSV-Read-Transform | Line-Read-Transform }
JSON-Read-Transform ::=
'JSONata(' JSONata-Expr ')'
CSV-Read-Transform ::=
'CSV(' Cell-Reference ')'
Line-Read-Transform ::=
'Line(' Line-Number ')'
Where:
-
'JSONata(' ... ')' indicates the contents of the parentheses is a JSONata query.
-
JSONata-Expr is a JSONata Expression to select and transform data from a topic value formatted using JSON.
-
'CSV(' ... ')' indicates the contents of the parentheses is a cell reference.
-
Cell-Reference is a spreadsheet style cell reference to select a row and column.
For example A1 or D50
-
Line-Number is a 1-based line number indicating which text line to return.
Examples
-
Read the first line of a plain text document:
Line(1)
-
Read row 2 and column 3 of a CSV document:
CSV(C2)
-
Read an array element of a JSON formatted document:
JSONata(A[4])
Further Information
Fernhill SCADA Concepts
To learn about other Fernhill SCADA Concepts.
Glossary
For the meaning of terms used in Fernhill SCADA.