Page 1 of 1

File in sub folder

Posted: Wed Jun 22, 2016 1:06 pm
by ronarch
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

Re: File in sub folder

Posted: Wed Jun 22, 2016 1:19 pm
by Support_Rick
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.

Re: File in sub folder

Posted: Thu Jun 23, 2016 3:12 pm
by ronarch
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

Re: File in sub folder

Posted: Thu Jun 23, 2016 5:11 pm
by Support_Rick
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.