LEFT (Left Substring)
Extracts the first L characters from the start of string IN and writes the result to the target STRING variable.
Description
LEFT returns the leftmost length (L) characters of src (IN). Use it to extract station prefixes, header codes, or barcode prefixes.
Syntax
- variable_name: Target
STRINGvariable - qualifier: Typically
ActionQualifier.P(Pulse) - instruction:
ActionInstruction.LEFT - src (
IN): SourceSTRINGvariable or literal - length (
L): Number of characters to extract (INTvariable or literal)
Sequence Visual Editor
- Select an action on a step or transition and hold Alt (or right-click -> Edit Qualifier & Instruction).
- Select Strings -> LEFT and choose the P qualifier.
- Fill in the target
STRINGvariable, source string (IN), and character count (L).
Python
from automation_machine import ActionQualifier, ActionInstruction
step.add_action("prefix_code", "Extract 3-char prefix", qualifier=ActionQualifier.P, instruction=ActionInstruction.LEFT, src="barcode", length="3")