<< Click to Display Table of Contents >> Navigation: 3. Script Language > TXT. Text-File Engine > Conversions > CRLF_to_CR |
MiniRobotLanguage (MRL)
TXT.crlf_to_cr
TXT.crr
Replace all $crlf$ (ASC 13,10) from the TXT.-internal Buffer with a $cr$ (ASC 13).
Intention
This command will do a Replace of all ASC 13,10 Characters ($crlf$) with ASC(13) $cr$ 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.
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.crp
TXT.Get_Line_Count|$$NUM
IVV.$$NUL<5
$$ERR=Ist die Datei leer?
GTO.ero
EIF.
DBP.$$NUL Zeilen geladen
TXT.crr
TXT.Save|$$FIA
Syntax
TXT.crlf_to_cr
TXT.crr
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.crp
TXT.Get_Line_Count|$$NUL
IVV.$$NUL<5
$$ERR=File is empty.
GTO.ero
EIF.
DBP.$$NUL Zeilen geladen
TXT.crr
TXT.Save|$$FIA
ENR.
Remarks
-
Limitations:
-
See also:
• IEF. / NEF. - If - exist - File