LF_to_CRLF

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > TXT. Text-File Engine > Conversions >

LF_to_CRLF

TXT.lfp

Previous Top Next


MiniRobotLanguage (MRL)

 

TXT.lf_to_crlf

TXT.lfp
Replace all $lf$ (ASC 10)  from the TXT.-internal Buffer with a new Line ($crlf$ ASC 13,10).

 

 

Intention

 

This command will do a Replace of all ASC 10 Characters (LineFeed) with ASC(13,10) $crlf$ in the complete loaded Text.

Some files - for example csv-files that have been exported from MS-Office Excel, may not contain a $crlf$ at the end of each line,

but may contain just a $lf$ instead.

To work with these files, we must change the Line-End to $crlf$.

If there are zero $cr$ in the file, the TXT.Load_Textfile Command may do that automatically.

Sometimes if there are still a few $cr$ inside the text, then you need to do that manually.

 

' Change Line Number $$NUM into $$NEW

TXT.Load_Textfile|$$FIA|$$NUM

TXT.lfp

TXT.Get_Line_Count|$$NUM

DBP.$$NUL Lines loaded.

 

 

Syntax

 

 

TXT.lf_to_crlf

TXT.lfp

 

 

Parameter Explanation

-

 

Example

 

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

' EXAMPLE 1: TXT.lfp

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

IEM.

 VAR.$$FIA=$cmdexe$

ELS.

 VAR.$$FIA=?exeloc\BEISPIEL_1.csv  

EIF.

 

NEF.$$FIA

 $$ERR=Sourcefile: $$FIA$crlf$ is missing.

 GTO.ero

EIF.

'-----------------------------------------------------------

TXT.Load_Textfile|$$FIA|$$NUL

TXT.lfp

TXT.Get_Line_Count|$$NUL

IVV.$$NUL<5

 $$ERR=File is empty.

 GTO.ero

EIF.

DBP.$$NUL Zeilen geladen

 

 

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

  IEF. / NEF. - If - exist - File

  LFF - Line-From-File

  WFF. - Wait-For-File

  TXT.Set_Line_to