Look-up
Command Description
Specify a folder path, find the specified file or folder support in the specific folder. Fuzzy matching and the wildcard * are supported
Command Prototype
arrayRet = File.SearchFile(sPath,sFileName,bIsDeep)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
sPath | True | path | '''C:\Users''' | The path of the folder to be searched. You can fill in the absolute path or use the @res "path" form to indicate the path under the res folder of the current process. The path separator must be escaped, such as "C:\Laiye RPA" or @res"Laiye RPA \Laiye RPA" |
sFileName | True | string | "" | Filename to find, the wildcard * is supported |
bIsDeep | True | boolean | True | Whether to use deep search, if Yes, it will continue to search the folders under the given path, until it reaches the root file |
return
arrayRet,The variable used to save the output of the command.
Demo
/****************************************Find ********* ****************************
Command prototype:
arrayRet = File.SearchFile('''C:\Users''',"",true)
Input parameters:
sPath--the folder path to search
sFileName--the file name to find, wildcards are supported*
blsDeep--whether to search in depth, if so, it will continue to search in the folder under the given path, until the end file is found
Outgoing parameters:
arrayRet--The result after the command is run
********************************************************************************/
Dim sPath='''C:\Users\Chance\Desktop\testFile'''
Dim sFileName="data.txt"
arrayRet = File.SearchFile(sPath,sFileName,true)
TracePrint(arrayRet)