FIL. - File-Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Filesystem-Commands > FIL. - File-Commands >

FIL. - File-Commands

FIL.Move numbered FIle

Previous Top Next


MiniRobotLanguage (MRL)

 

FIL.mov

FIL.Move numbered File

Move/Insert a file within a List of numbered Files up or down by swapping all intermediate files

 

NTFS-Direct

 

Intention

 

This command is used to move files with a builtin Number between more such files.

For example, you want to move the File "File_02.txt" to Position "04" as "File_04.txt".

You could just Swap the files but then "File_02.txt" would be at Position "4".

So this command will now start swapping files in the right order, to insert the file at the right position.

All other files are just moved one place downward.

You could also think of "Insert numbered file" in this command.

 

 

 

Move UP or DOWN?

If the file is moved "UP" or "DoWN", depends only on the Start- and End-Number Parameter.

If Start is higher, then the file is moved upwards until the END-Number.

If Start is lower number, then the file is moved downwards to the higher END-Number.

 

Generally the "?" in the Filename is replaced with the number during the process.

 

'Teste FIL "GNN mit Folder".

VAR.$$LAA=?path\Testfolder\

$$LAB=$$LAAFile_?.txt

' Move File_002 to the Place of File_009 shiftig the inbetween files one place up

FIL.mov|$$LAB|2|8|3|$$RES

' Move file 009 to place of file 001 shiftig ann inbetween files one place down

FIL.mov|$$LAB|9|1|3|$$RES

 

 

This is how such "Numbered files" look.

 

fil_gnf

 

 

 

Syntax

 

 

FIL.mov|P1|P2|P3[|P4][|P5]

FIL.Move numbered File|P1|P2|P3[|P4][|P5]

 

 

Parameter Explanation

 

P1 - Filename and Path, it must contain a "?".
 The "?" will be replaced with the formatted Number during the process.

 If P1 ends with a \ then its taken as a folder-name.

   

P2 - (numeric) Variable or value with the number of the File to Move.

 

P3 - (numeric) Variable or value with the number of the target-place.

 

P4 - (numeric) Variable or value with number of digits to format the number.

 0/1 - do not format the numbers,  e.g. File_2.txt

 2 and higher:  - format with number of digits in P3, 
 Default: Numbers will not be formatted.

 

P5 - (Output) Variable with the result of the operation.

 If omitted the result is placed on TOS.

 

 

Example

 

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

' EXAMPLE 2: FIL.gnn

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

'Teste FIL "MOV".

VAR.$$LAA=?path\Testfolder\

$$LAB=$$LAAFile_?.txt

$$LAC=$$LAAFile_002.txt

GMD.cf|$$LAC|$$CSA

FIL.mov|$$LAB|2|8|3|$$RES

JIV.$$RES!1|Lab_failed

$$LAC=$$LAAFile_008.txt

GMD.cf|$$LAC|$$CSD

JIS.$$CSA!$$CSD|Lab_failed

$$LAC=$$LAAFile_009.txt

GMD.cf|$$LAC|$$CSA

FIL.mov|$$LAB|9|1|3|$$RES

JIV.$$RES!1|Lab_failed

$$LAC=$$LAAFile_001.txt

GMD.cf|$$LAC|$$CSB

JIS.$$CSA!$$CSB|Lab_failed

ENR.

 

 

Remarks

 

Can access very large paths up to 32767 characters due to the use of NTFS-direct.

 

Limitations:

 

-

 

 

See also:

 

    Split File

    Join File

    OPT. - Optional Settings

    GEC. - Get Encryption

    RMD. - Remove-Directory

    ATF - Append-to-File

    CFF. - Copy-From-File

    CTF - Copy-To-File

    COP. - Copy File

    SHF. - Shell-File-Operation

    MDF. - Make-Direktory-File

    MKD. - Make-Directory

    GLC. - Get-Line-Count

    IEF. / NEF. - If - exist - File

    LFF - Line-From-File

    WFF. - Wait-For-File

    REN. - Rename File/Dir