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/16 16:59] – removed 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 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, | ||
+ | |||
+ | === Literal String Data === | ||
+ | |||
+ | 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. | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | The result of this command is | ||
+ | |||
+ | < | ||
+ | :: | ||
+ | </ | ||
+ | |||
+ | === 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: | ||
+ | |||
+ | < | ||
+ | Evaluate_Expression | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | === Negation === | ||
+ | |||
+ | Operators are only parsed as a single character, so the "/ | ||
+ | |||
+ | In order to negate an expression you can use the syntax " | ||
+ | |||
+ | ==== 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_RIGHT(string, | ||
+ | STRING_MID(string, | ||
+ | STRING_FIND(string, | ||
+ | |||
+ | and one command for measuring the string: | ||
+ | |||
+ | STRING_LENGTH(string) | ||
+ | |||
+ | === String_Left === | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | The result is: | ||
+ | |||
+ | < | ||
+ | ::TEST_LEFT = A12 | ||
+ | </ | ||
+ | |||
+ | === String_Right === | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | The result is: | ||
+ | |||
+ | < | ||
+ | :: | ||
+ | </ | ||
+ | |||
+ | === String_Mid === | ||
+ | |||
+ | Note that the two index parameters are zero-based for the STRING_MID function. | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | The result is: | ||
+ | |||
+ | < | ||
+ | ::TEST_MID = 345 | ||
+ | </ | ||
+ | |||
+ | === String_Find === | ||
+ | |||
+ | < | ||
+ | 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: | ||
+ | |||
+ | < | ||
+ | :: | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | The result is: | ||
+ | |||
+ | < | ||
+ | :: | ||
+ | </ | ||
+ | |||
+ | === String_To_Lower === | ||
+ | |||
+ | < | ||
+ | !Converting To_Upper and To_Lower String Data (more...) | ||
+ | |||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Select_Active_File | ||
+ | / | ||
+ | ! /QUERY= | ||
+ | ; | ||
+ | |||
+ | Create_Text_Data | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | |||
+ | Evaluate_Expression | ||
+ | / | ||
+ | ! / | ||
+ | ! / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ! / | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | === String_To_Upper === | ||
+ | |||
+ | To be completed... | ||
+ | |||
+ | === To_String === | ||
+ | |||
+ | To be completed | ||
+ | |||
+ | ==== Example: Extracting text ==== | ||
+ | |||
+ | Given the following Text_Data loaded from a file, | ||
+ | |||
+ | < | ||
+ | Random Stuff < | ||
+ | </ | ||
+ | |||
+ | this example demonstrates how to store the desired string "< | ||
+ | |||
+ | < | ||
+ | !Extract the name of the subject. | ||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | |||
+ | Set_Pipeline_Parameter_From_Expression | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ; | ||
+ | </ | ||
visual3d/documentation/pipeline/general_information/string_data.1721149141.txt.gz · Last modified: 2024/07/16 16:59 by sgranger