Get Text Segment
Command description
Extract a segment from text using the specified start position and extraction method, then save it as a new text variable.
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| Text Content | any | Source content. Lists are joined with newline characters; other values are converted to text first. |
| Start Position | enum | From First Character, From Specified Position, From Specified Text |
| Start Character Position | int or str | Required only when Start Position is From Specified Position. Positions are zero-based. |
| Start Text | any | Required only when Start Position is From Specified Text. Extraction starts at the first occurrence of this text. |
| Extraction Method | enum | To Last Character, Specified Length |
| Extraction Length | int or str | Required only when Extraction Method is Specified Length. Must be at least 0. |
Command Output Parameters
| Output parameters | Output parameter type | Description |
|---|---|---|
| Extracted Result | str | Extracted text |
Note
If Text Content is a list, its items are joined with newline characters. Other values are converted with str(), so None becomes "None".
Start Character Position and Extraction Length must be integers or text values that can be converted to integers.
When extracting from a specified position, Start Character Position is required and cannot be negative. Positions are zero-based. A position at or beyond the end of the source returns an empty string.
When extracting from specified text, Start Text is required. Extraction begins at the first match and includes Start Text. An error is raised if no match is found.
When using Specified Length, Extraction Length is required and cannot be negative. A length of 0 returns an empty string; a length greater than the remaining source text extracts through the end.
AI Workflow Generation Notes
- Position and length are measured in characters. Generate non-negative integers, not decimals or nonnumeric text.
- Generate only the parameters required by the selected enum values: Start Character Position for From Specified Position, Start Text for From Specified Text, and Extraction Length for Specified Length.