File in sub folder

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

ronarch

Posts: 2
Joined: Tue Jan 07, 2014 2:13 pm

Post by ronarch » Wed Jun 22, 2016 1:06 pm
Greetings,

I will be setting up a Monitor to watch a shared folder. New folders will be arriving in this folder throughout the day. Each folder that arrives will be a unique name, and it will always contain a subfolder called Ver1. In this sub folder there will be a pdf file that I need to grab and send to another shared folder.

In Monitor, there are 4 choices in "File Name Pattern": File Created or Modified, File Created, File Modified, File Deleted. I am actually looking for "Folder Created". Can we say that, for purposes of setting up the monitor, that "File" is synonymous with "folder"? And once I have found the "new" folder, what task should I use to drill down into the sub folder "Ver1", then extract the pdf file within?

Thank you,
Ron

Support_Rick

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

Post by Support_Rick » Wed Jun 22, 2016 1:19 pm
Ron,

To answer your question, no, the "File" is not synonymous with "Folder", even in this instance.

But, monitoring the "root" folder location and all "recursive" folders (Check box above the event type) will allow you to identify "*.pdf" files regardless of which sub-folder they exist within.

The ensuing file list variable (from the Project Tab) will contain the name of the PDF file as well as what folder (parentFile attribute) in which the file resides. This should get you to what you need.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696

ronarch

Posts: 2
Joined: Tue Jan 07, 2014 2:13 pm

Post by ronarch » Thu Jun 23, 2016 3:12 pm
Hi Rick,

The list variable does contain the complete path. But I am only interested in copying the pdf file to the destination network share, and not the root folder and sub folder. I'd like to isolate the pdf file name, perhaps by stripping the folder tree from it somehow. In other words, take \rootfolder\ver1\12345.pdf and just copy 12345.pdf to a destination resource.
Thanks, Ron

Support_Rick

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

Post by Support_Rick » Thu Jun 23, 2016 5:11 pm
Ron,

That's exactly what you'll be able to do with what I was describing above.

Creating the filelist from a monitor across recursive folders gives you the file name "\rootfolder\ver1\12345.pdf" in whatever folder that you can now deal with because it's in a filelist variable.

Looping through that file list .. I can point to any attribute of that file...

Name
Path
Size
Name without extension
Last modified date
parent file
etc...

Meaning .. I can grab the file as it sits "\rootfolder\ver1\12345.pdf" (not the path/folder, just the file) and (copy/FTP/SFTP/move,etc) that file to a destination.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
4 posts Page 1 of 1