![]() |
| |||||||
Automation Anywhere Post messages and questions related to Automation Software here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
|
Hi there, I am having some troubles with WildCards. Here is my situation. I have to download files from an FTP, given an specific String wich is returned by a Query. The problem is that Files, contains that String in the middle of the name. For example xxxSTRINGxxx.zip bbbStringbbb.txt In "Get Files" , i 've tried the following: *$Dataset Column(4)*.* And it doesn't work. However, if i try xxx$Dataset Column(4)*.* or bbb$Dataset Column(4)*.* it works. Suggestions? am i doing something wrong? Thanks in advance |
| |||
|
Hello, This feature, wild card support at the beginning of filename, has already been forwarded to the product development team for implementing it in the upcoming version of product. Currently what you can do is, download *.* i.e. all files in a particular FTP folder into some temporary folder on your hard drive say C:\Temp. After the files are downloaded, you can use 'Loop for each file in a folder' to loop through all the downloaded files and inside loop block use 'If Variable' command to check if current filename includes particular string. If yes then copy that file to destination folder using ‘Copy Files’ command inside If-End if block. After 'End Loop' you can delete all the files in temp folder. The text format of commands would appear something like this, FTP/SFTP : Connect to "www.ftpserver.com" FTP/SFTP : Change Folder "/Folder1" FTP/SFTP : Get File "*.*" FTP/SFTP : Disconnect Start Loop " Each File in C:\Temp" If $FileName$ Includes "string" Then Copy Files "$CurrentDirectory$\$FileName$.$Extension$" to "C:\DestinationFolder\" End If End Loop Delete Files "C:\Temp\*.*" Hope that helps. |
| |||
|
No I didn't try it... because it is not what I need... I need to get files that start with DSM_ and contain 20100317 somewhere in the name. What you suggested will get more than just those files... it is completely different from DSM_*2010317*.* You say "two wild card(*) in one string could be the issue"... are you saying that you don't know how your software works... aren't you interested in finding out? Last edited by TylerMitton; 03-23-2010 at 02:25 PM. |
| |||
|
Hello, We could not reproduce the mentioned scenario at our end. You need to try this, . Download DSM_* files to some temp folder on hard drive. . Loop for each file in temp folder. . Inside Loop block using 'If Variable' command check if $Filename$ includes 20100317 then using Copy Files command copy that particular file to destination folder (inside If-Endif block). . Delete all files in a temp folder after End Loop. Below is the text format, 1) FTP/SFTP : Connect to "ftp.tethyssolutions.com" 2) FTP/SFTP : Get All Remote Files in Folder "folder1" with criteria "DSM_*.*" 3) FTP/SFTP : Disconnect 4) Start Loop " Each File in D:\Temp" 5) If $FileName$ Includes "20100317" Then 6) Copy Files "$CurrentDirectory$\$FileName$.$Extension$" to "C:\DesiredFolder\" 7) End If 8) End Loop 9) Delete Files "D:\Temp\*.*" If you can provide your FTP configuration, we can create specific sample for your convenience. Hope that helps. |
![]() |
| Thread Tools | |
| Display Modes | |
| |