Get single file with wildcard

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
2 posts Page 1 of 1

monahanks

Posts: 41
Joined: Wed Mar 30, 2011 10:19 am

Post by monahanks » Wed Aug 07, 2013 1:32 pm
I am creating a project that needs to retrieve a single file with a name pattern similar to "file_date_time.txt". I then put the file to a specified network directory on our network, and then go back to the remote system to delete the file. When the file is put to our network, I need to change the name to "file.txt". However, the rename function does not work for filesets.

I know I can do a GET with a fileset and wildcard function to retrieve the file, but is there a way to use the (local) fileset name back on the remote system for the delete? Or a way to populate a variable with the file name and use the variable in the remote delete?

Thanks,

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Mon Aug 26, 2013 9:59 am
MonaHanks,

There are several things here that can help you with your current situation.

First, you can add a Prefix/Suffix to your FileSet on a GET as in:
SFTP Get Rename.JPG
This attaches the value (like a Date/TimeStamp) to the Beginning or End of each file being retrieved. Also, utilizing the Variables during the Get:
SFTP Get Vars.JPG
This allows you to directly address the files on the Destination (Local Server) or the Source (Remote Server). Thus, allowing you to specifically go back and delete only the files you downloaded from the Remote Server with just a single Remote File List Variable associated to the "Processed Source Files Variable".

The "Destination Files Variable" is a Local File List Variable that will allow you to perform actions on that list as well, once the files have been retrieved to your local system.

One other thing that might help ... GoAnywhere Director has a function on the Advanced (s)FTP(s) tabs that allow you to utilize Persistent Connections.
SFTP Advanced Tab.JPG
This means you make the single FTP connection to GET the files from the Source Server. By using this Persistent Variable ID later in your project to delete the files on the Source Server, you don't have to make another connection, the connection remains open from the original GET of the files.

Hope this helps!
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1