MarkerExtract
Creates a new event variable based on existing marker variable.
Syntax
MarkerExtract(doc, MarkerVariableName, ExtractString)
Parameters
Parameter |
Type |
Description |
---|---|---|
doc |
documentReference |
Reference to the document |
MarkerVariableName |
string |
The name of the marker variable |
ExtractString |
string |
Extract string. See comments. |
Return
New event variable.
Note
ExtractString contains a list of items separated by commas.
Items AND
or OR
should be placed between the conditions for the same field.
Conditions for each marker field should end with the item EOF
. The last item in ExtractString list should be END
.
For example, assume that we have a marker variable Strobed
with one field that contains integer values.
To extract all the timestamps with the field value 3 you may use the following command:
doc["NewEvent"] = MarkerExtract(doc, "Strobed", "=3,EOF,END")
To extract all the timestamps with the field values 3, 4 and 5 you may use the command:
doc["NewEvent"] = MarkerExtract(doc, "Strobed", ">2,AND,<6,EOF,END")
To use string comparisons in timestamp extraction, add $ sign at the beginning of the string.
For example, to extract timestamps with Ev_Marker
field value WL
, use:
doc["NewEvent1"] = MarkerExtract(doc, "Ev_Marker", "=$WL,EOF,END")
Examples
Python
import nex
doc = nex.GetActiveDocument()
doc["NewEvent"] = nex.MarkerExtract(doc, "Strobed", "=3,EOF,END")
NexScript
doc = GetActiveDocument()
doc["NewEvent"] = MarkerExtract(doc, "Strobed", "=3,EOF,END")