Script

FTP

The professional tool to automate FTP, SFTP, FTPS

and schedule FTP batch jobs

Syntax:

COUNTELEMENTS(list)

  • list: A list which number of elements will be counted.

See also:

GETLIST
Lesson 5: Handling file lists

Command history:

This command was added in ScriptFTP version 3.2 as a hidden command but was finally documented for the v3.3.

Example:

# Get the remote file listing, store it in $list
GETLIST($list,REMOTE_FILES,"*.txt")
 
# Calculate the number of elements in the list
$number_of_elements=COUNTELEMENTS($list)
 
IF($number_of_element > 0)
    PRINT("Found ".$number_of_elements." text files")
ELSE
    PRINT("No text files found")
END IF