CR_to_CRLF

<< Click to Display Table of Contents >>

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

CR_to_CRLF

TXT.crp

Previous Top Next


MiniRobotLanguage (MRL)

 

TXT.cr_to_crlf

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

 

 

 

Intention

 

This command will do a Replace of all ASC 13 Characters (CR) 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 $cr$ instead.

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

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

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

 

' Change Line Number $$NUM into $$NEW

TXT.Load_Textfile|$$FIA|$$NUM

TXT.crp

TXT.Get_Line_Count|$$NUM

IVV.$$NUL<5

 $$ERR=Ist die Datei leer?

 GTO.ero

EIF.

DBP.$$NUL Zeilen geladen

 

 

Syntax

 

 

TXT.cr_to_crlf

TXT.crp

 

 

Parameter Explanation

-

 

Example

 

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

' EXAMPLE 1: TXT.crp

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

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.crp

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