|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > LST. - List Arrays > Text-Document Operations > Smart Package Robot 's List Commands |
MiniRobotLanguage (MRL)
LST.TextLoad
Load the contents of a text file into a container
Intention
The LST.TextLoad command loads the contents of a text file into a container. Each line in the text file is added as a separate element in the container. This is useful for processing or manipulating text files line by line.
The command takes two parameters: the handle of the container and the file path of the text file to load.
Syntax
LST.TextLoad|P1|P2
Parameter Explanation
P1 - The handle of the container. This is typically a variable that contains the handle of the container.
P2 - The file path of the text file to load into the container.
Example
'***********************************
' LST.TextLoad Sample
'***********************************
' Create a new list
LST.New|$$LST
' Load a text file into the list
LST.TextLoad|$$LST|C:\Temp\MyTextFile.txt
' Display the number of lines loaded
LST.Count|$$LST|$$CNT
DBP.Number of lines loaded: $$CNT
' End the script
ENR.
Remarks
-
Limitations:
- The file must exist and be accessible.
- The file must be a plain text file.
See also:
• LST.Add - Add Element to List
• LST.Count - Count Elements in List