visual3d:documentation:pipeline:general_information:string_data
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:general_information:string_data [2024/07/12 14:04] – created sgranger | visual3d:documentation:pipeline:general_information:string_data [2025/06/25 14:45] (current) – 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 ==== |
- | STRING_LEFT(string, | + | === String_To_Lower === |
- | STRING_RIGHT(string, | + | |
- | STRING_MID(string, | + | |
- | STRING_LENGTH(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. | + | |
- | \\ | + | < |
+ | !Converting To_Upper and To_Lower String Data (more...) | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
- | == Parsing String Data (more...) == | + | Set_Pipeline_Parameter_From_Expression |
- | + | / | |
- | **Set_Pipeline_Parameter_From_Expression** | + | / |
- | / | + | |
- | / | + | |
/ | / | ||
- | **;** | + | ; |
- | The result is | + | |
- | :: | + | Select_Active_File |
- | == String_Left == | + | /FILE_NAME=GLOBAL |
+ | ! /QUERY= | ||
+ | ; | ||
- | **Set_Pipeline_Parameter_From_Expression** | + | Create_Text_Data |
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | === String_To_Upper === | ||
+ | |||
+ | To be completed... | ||
+ | |||
+ | === To_String === | ||
+ | |||
+ | To be completed | ||
+ | |||
+ | ==== Parsing ==== | ||
+ | |||
+ | Given a pipeline parameter that is a string, there are four commands that extract a portion of a string and one command for measuring the string. | ||
+ | |||
+ | === String_Left === | ||
+ | |||
+ | STRING_LEFT(string, | ||
+ | |||
+ | < | ||
+ | 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 === |
+ | |||
+ | STRING_RIGHT(string, | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
/ | / | ||
/ | / | ||
- | **;** | + | ; |
- | The result is | + | </ |
+ | The result is: | ||
+ | |||
+ | < | ||
:: | :: | ||
- | == String_Mid == | + | </ |
+ | |||
+ | === String_Mid === | ||
+ | |||
+ | STRING_MID(string, | ||
- | **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** | + | STRING_FIND(string, substring, start) |
- | + | ||
- | / | + | |
- | / | + | |
- | / | + | |
- | **;** | + | |
- | The result is | + | |
- | + | ||
- | :: | + | |
- | **Set_Pipeline_Parameter_From_Expression** | + | |
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
/ | / | ||
- | / | + | / |
/ | / | ||
- | **;** | + | ; |
- | The result is | + | </ |
- | ::TEST_INDEX = 2 | + | Because the string we are searching for " |
- | \\ | + | |
+ | < | ||
+ | :: | ||
+ | </ | ||
- | == String_Find | + | === String_Reverse_Find === |
- | **Set_Pipeline_Parameter_From_Expression** | + | To be completed... |
- | / | + | === String_Length === |
- | / | + | |
+ | STRING_LENGTH(string) | ||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
/ | / | ||
- | **;** | + | ; |
- | The result is | + | </ |
- | ::TEST_INDEX = -1 | + | The result is: |
- | == String_Reverse_Find == | + | |
- | == String_To_Lower == | + | < |
+ | :: | ||
+ | </ | ||
- | !Converting To_Upper and To_Lower String Data (more...) | + | < |
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
- | **Set_Pipeline_Parameter_From_Expression** | + | The result is: |
- | / | + | |
- | / | + | |
- | / | + | |
- | **;** | + | |
- | **Set_Pipeline_Parameter_From_Expression** | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | **;** | + | |
- | **Select_Active_File** | + | |
- | / | + | |
- | ! /QUERY= | + | |
- | **;** | + | |
- | **Create_Text_Data** | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | **;** | + | |
- | **Evaluate_Expression** | + | |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | ! / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | **Evaluate_Expression** | + | |
- | / | + | |
- | ! / | + | |
- | ! / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | ! / | + | |
- | **;** | + | |
- | == String_To_Upper == | + | |
- | == To_String == | + | < |
+ | :: | ||
+ | </ | ||
- | == Example: | + | ==== Example: |
- | Given the following Text_Data loaded from a file store in a signal TEXT_DATA:: | + | 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.1720793068.txt.gz · Last modified: 2024/07/12 14:04 by sgranger