<< Click to Display Table of Contents >> Navigation: 3. Script Language > TXT. Text-File Engine > Conversions > LF_to_CRLF |
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:
• IEF. / NEF. - If - exist - File