visual3d:documentation:pipeline:general_information:string_data
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
visual3d:documentation:pipeline:general_information:string_data [2024/07/17 15:46] – created sgranger | visual3d:documentation:pipeline:general_information:string_data [2024/10/04 15:36] (current) – Initial rework - the page is still missing string function descriptions. wikisysop | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== String Data ====== | + | ===== String Data ===== |
- | ==== Contents ==== | + | String data is fundamentally different from time-varying signals and metrics so we have created a collection of string-specific functions within [[visual3d: |
+ | ==== Syntax ==== | ||
+ | Within Evaluate_Expression, | ||
- | * [[#Syntax|1 Syntax]] | + | === Literal |
- | * [[#Modify|2 Modify]] | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
- | * [[# | + | |
+ | Strings can be explicitly created within a pipeline script without having to be stored as a pipeline variable. To accomplish this, all that needs to be done is to use quotes. | ||
- | === Syntax === | + | < |
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | /EXPRESSION=" | ||
+ | /AS_INTEGER=FALSE | ||
+ | ; | ||
+ | </ | ||
- | Quotes are to be used around string data in an expression to differentiate it from variable names. ie; subject_name=" | + | The result |
- | For example, there is a problem with the following evaluate_expression: | + | < |
+ | :: | ||
+ | </ | ||
- | **Evaluate_Expression** | + | === Concatenation === |
+ | Literal string data must be explicitly concatenated with values from parameters. For example, there is a problem with the following Evaluate_Expression syntax: | ||
+ | |||
+ | < | ||
+ | Evaluate_Expression | ||
/ | / | ||
/ | / | ||
! / | ! / | ||
! / | ! / | ||
- | **;** | + | ; |
+ | </ | ||
This uses a pipeline parameter in the middle of a string parameter (the EXPRESSION). Global parameters cannot be evaluated in the middle of a string, so to recognize that a pipeline parameter, you need to concatenate it into the expression as follows: | This uses a pipeline parameter in the middle of a string parameter (the EXPRESSION). Global parameters cannot be evaluated in the middle of a string, so to recognize that a pipeline parameter, you need to concatenate it into the expression as follows: | ||
- | **Evaluate_Expression** | + | < |
+ | Evaluate_Expression | ||
/ | / | ||
/ | / | ||
! / | ! / | ||
! / | ! / | ||
- | **;** | + | ; |
- | Currently, the operators are only parsed as a single character, so the use of "/=" (not equals) cannot be used yet. You can do NOT(item1=item2) in order to process a not equals currently, but this will change shortly to allow "/ | + | </code> |
- | === Modify | + | === Negation |
- | === Parsing === | + | Operators are only parsed as a single character, so the "/=" notation for "not equals" |
- | Given a pipeline parameter that is a string. For internal reasons, | + | In order to negate an expression you can use the syntax " |
- | There are 3 commands that extract a portion of a string. | + | ==== Modify ==== |
+ | |||
+ | ==== Parsing ==== | ||
+ | |||
+ | Given a pipeline parameter that is a string, there are four commands that extract a portion of a string: | ||
STRING_LEFT(string, | STRING_LEFT(string, | ||
STRING_RIGHT(string, | STRING_RIGHT(string, | ||
STRING_MID(string, | STRING_MID(string, | ||
- | STRING_LENGTH(string) | ||
STRING_FIND(string, | STRING_FIND(string, | ||
- | **NOTE:** When referencing strings, the string should be surrounded by quotes. This identifies to Visual3D that you are referencing a string, and not a file name etc. | ||
- | \\ | + | and one command for measuring the string: |
+ | STRING_LENGTH(string) | ||
- | == Parsing String Data (more...) | + | === String_Left |
- | + | ||
- | **Set_Pipeline_Parameter_From_Expression** | + | |
- | / | + | |
- | /EXPRESSION=" | + | |
- | / | + | |
- | **;** | + | |
- | The result is | + | |
- | :: | + | < |
- | == String_Left == | + | Set_Pipeline_Parameter_From_Expression |
- | + | ||
- | **Set_Pipeline_Parameter_From_Expression** | + | |
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | The result is | + | </ |
+ | The result is: | ||
+ | |||
+ | < | ||
::TEST_LEFT = A12 | ::TEST_LEFT = A12 | ||
- | == String_Right == | + | </ |
- | **Set_Pipeline_Parameter_From_Expression** | + | === String_Right === |
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | The result is | + | </ |
+ | The result is: | ||
+ | |||
+ | < | ||
:: | :: | ||
- | == String_Mid == | + | </ |
+ | |||
+ | === String_Mid === | ||
+ | |||
+ | Note that the two index parameters are zero-based for the STRING_MID function. | ||
- | **Set_Pipeline_Parameter_From_Expression** | + | < |
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | The result is | + | </ |
+ | The result is: | ||
+ | |||
+ | < | ||
::TEST_MID = 345 | ::TEST_MID = 345 | ||
- | //Note: For STRING_MID the number values are zero based// | + | </code> |
- | == String_Length | + | === String_Find === |
- | **Set_Pipeline_Parameter_From_Expression** | + | < |
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | Because the string we are searching for " | ||
+ | |||
+ | < | ||
+ | :: | ||
+ | </ | ||
+ | |||
+ | === String_Reverse_Find === | ||
+ | |||
+ | To be completed... | ||
+ | |||
+ | === String_Length === | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | The result is | + | </ |
+ | |||
+ | The result is: | ||
+ | < | ||
:: | :: | ||
- | **Set_Pipeline_Parameter_From_Expression** | + | </ |
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | The result is | + | </ |
+ | The result is: | ||
+ | |||
+ | < | ||
:: | :: | ||
- | \\ | + | </code> |
- | + | ||
- | + | ||
- | == String_Find == | + | |
- | + | ||
- | **Set_Pipeline_Parameter_From_Expression** | + | |
- | + | ||
- | /PARAMETER_NAME=TEST_INDEX | + | |
- | / | + | |
- | / | + | |
- | **;** | + | |
- | The result is | + | |
- | + | ||
- | :: | + | |
- | == String_Reverse_Find == | + | |
- | == String_To_Lower == | + | === String_To_Lower |
+ | < | ||
!Converting To_Upper and To_Lower String Data (more...) | !Converting To_Upper and To_Lower String Data (more...) | ||
- | **Set_Pipeline_Parameter_From_Expression** | + | Set_Pipeline_Parameter_From_Expression |
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | **Set_Pipeline_Parameter_From_Expression** | + | |
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | **Select_Active_File** | + | |
+ | Select_Active_File | ||
/ | / | ||
! /QUERY= | ! /QUERY= | ||
- | **;** | + | ; |
- | **Create_Text_Data** | + | |
+ | Create_Text_Data | ||
/ | / | ||
/ | / | ||
Line 163: | Line 197: | ||
! / | ! / | ||
! / | ! / | ||
- | **;** | + | ; |
- | **Evaluate_Expression** | + | |
+ | Evaluate_Expression | ||
/ | / | ||
! / | ! / | ||
Line 173: | Line 208: | ||
/ | / | ||
! / | ! / | ||
- | **;** | + | ; |
- | **Evaluate_Expression** | + | |
+ | Evaluate_Expression | ||
/ | / | ||
! / | ! / | ||
Line 183: | Line 219: | ||
/ | / | ||
! / | ! / | ||
- | **;** | + | ; |
- | == String_To_Upper == | + | </ |
- | == To_String | + | === String_To_Upper === |
- | == Example: Extract text (more...) == | + | To be completed... |
- | Given the following Text_Data loaded from a file store in a signal TEXT_DATA:: | + | === To_String === |
+ | |||
+ | To be completed | ||
+ | |||
+ | ==== Example: Extracting text ==== | ||
+ | |||
+ | Given the following Text_Data loaded from a file, | ||
+ | |||
+ | < | ||
Random Stuff < | Random Stuff < | ||
+ | </ | ||
- | Extract the name of the subject. | + | this example demonstrates how to store the desired string "< |
- | **Set_Pipeline_Parameter_From_Expression** | + | |
+ | < | ||
+ | !Extract the name of the subject. | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | **Set_Pipeline_Parameter_From_Expression** | + | |
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | **Set_Pipeline_Parameter_From_Expression** | + | |
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | The resulting pipeline parameter contains " | + | </ |
visual3d/documentation/pipeline/general_information/string_data.1721231160.txt.gz · Last modified: 2024/07/17 15:46 by sgranger