CRLF_to_LF

<< Click to Display Table of Contents >>

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

CRLF_to_LF

TXT.lfr

Previous Top Next


MiniRobotLanguage (MRL)

 

TXT.crlf_to_lf

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

 

 

 

Intention

 

This Command will do a Replace of all ASC 13,10 Characters ($crlf$) with ASC(10) $lf$ 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 $cr$ 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.

Now when you want to convert it back, before you save the file, you can use this Command.

 

 

' Change Line Number $$NUM into $$NEW

TXT.Load_Textfile|$$FIA|$$NUM

TXT.lfp

TXT.Get_Line_Count|$$NUM

IVV.$$NUL<5

 $$ERR=Ist die Datei leer?

 GTO.ero

EIF.

DBP.$$NUL Zeilen geladen

TXT.lfr

TXT.Save|$$FIA

 

Syntax

 

 

TXT.crlf_to_lf

TXT.lfr

 

 

Parameter Explanation

-

 

Example

 

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

' EXAMPLE 1: TXT.crr

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

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

TXT.lfr

TXT.Save|$$FIA

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

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

•   LFF - Line-From-File

•   WFF. - Wait-For-File

•   TXT.Set_Line_to