String-Commands * TXT-Command

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > TXT. Text-File Engine > Get Lines and Text >

String-Commands * TXT-Command

TXT.Get_Line_trimmed

Previous Top Next


MiniRobotLanguage (MRL)

 

TXT.glt

TXT.TXT.Get_Line_trimmed
Get Line with the specified Number from TXT.-internal Buffer into Variable and trim Spaces from both sides.

 

 

 

Intention

 

This Command is used to get a specified Line from the Text that is in the Internal TXT-Buffer into a Variable.

It will also trim all Spaces and TAB's from both sides.

Variable P2 will contain the Line Nr. P1.
 

This Command can be used to work on a "Line by line" base through a file without accessing the file on the harddrive.

 

' Get Line Number $$NUM into $$LIN

$$NUM=10

TXT.glt|$$NUM|$$LIN

MBX.Line 10 is: $crlf$ $$LIN

 

 

Syntax

 

 

TXT.glt|P1[|P2]

TXT.Get_Line_trimmed|P1[|P2]

 

 

Parameter Explanation

 

P1 - (Input,numeric) Variable with Line-Number.

P2 - (Output) Variable will contain the Line. If omitted, the line is placed on TOS.

 

 

Speed in Ticks:

This Command uses typically around 250 Ticks.

 

Example

 

'*****************************************************

' EXAMPLE 1: TXT.gel

'*****************************************************

VAR.$$LAA=?path\..\Pics\Test.txt

CFF.$$LAA|$$RES

TXT.lpt|$$RES|$$LAA

' Now we get only Line 5

TXT.glt|5|$$LIN

MBX.Line 5 is: $$LIN

ENR.

 

 

Remarks

 

-

 

Limitations:

 

-

 

 

See also:

 

•   TXT.Load Textfile

•   TXT.Clear

•   TXT.From_Var

•   TXT.Load_pure_Text

•   TXT.Get_pure_Text

•   FIL.Generate numbered Name

•   FIL.Move numbered File

•   ATF - Append-to-File

•   CFF. - Copy-From-File

•   CTF - Copy-To-File

•   COP. - Copy File

•   TXT.Get_Filename

•   TXT.Get_Lenght

•   TXT.To_Var_and_Clear

•     GLC. - Get-Line-Count

•     TXT.Get_Line

•     TXT.get_line_lefttrim

•     TXT.Get_Line_trimmed

•     IEF. / NEF. - If - exist - File

•     LFF - Line-From-File

•     WFF. - Wait-For-File

•     REN. - Rename File/Dir