Filesystem-Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Filesystem-Commands >

Filesystem-Commands

CVF. -  Convert File

Previous Top Next


MiniRobotLanguage (MRL)

 

CVF. Command

Coonvert File / Replace in File

 

 

Intention

 

This command is used to replace characters in a file and then write the file to an output file. Technically CVF. will load the whole file into memory and then do the replace.

 

You can convert files with different line-endings:

 

$$FIL=?path\MyFIle.xml

$$OUT=?path\MyFIle.txt

$$MAC=$lf$

$$PCE=$crlf$

CVF.$$FIL|$$MAC|$$PCE|$$OUT

 

or you can convert a XML-File into a textual readable file:

 

$$FIL=?path\MyFIle.xml

$$OUT=?path\MyFIle.txt

$$XML=><

$$PCE=>$crlf$<

CVF.$$FIL|$$XML|$$PCE|$$OUT

 

If you omit P4 then P1 is overwritten without further asking!

 

 

 

Syntax

 

 

CVF.P1|P2|P3[|P4]

 

 

Parameter Explanation

 

P1 - Filename

P2 - (Replace) Text or Data that is going to be replaced

P3 - (with) Text or Data that is going to replace the text P2

P4 - Opt. Variable which contains the Output filename, that the processed

          file should be written to. If omitted P1 is overwritten!

 

 

 

Example

 

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

' EXAMPLE 1: CVF.

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

$$FIL=?path\MyFIle.xml

$$OUT=?path\MyFIle.txt

$$MAC=$lf$

$$PCE=$crlf$

CVF.$$FIL|$$MAC|$$PCE|$$OUT

MBX.!

END.

 

 

 

Remarks

 

Existing files with the given file-name P4 will be overwritten without any confirmation-request.

 

 

Limitations:

 

-

 

 

See also:

 

    3.3 Specialfolders

    CTF. - Copy-To-File

    ATF - Append-to-File

    CFF. - Copy-From-File

    CTI. - Copy-To-Inifile

    CFI. - Copy-From_IniFile

    GLC. - Get-Line-Count

    IEF. / NEF. - If - exist - File

    LFF - Line-From-File

    COP. - Copy File

    SHF. - Shell-File-Operation

    WFF. - Wait-For-File