WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> Automation of File Movement - Pattern based
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1501697124

Message started by Ken White on Aug 2nd, 2017 at 8:05pm

Title: Automation of File Movement - Pattern based
Post by Ken White on Aug 2nd, 2017 at 8:05pm
Here's my request.  I need to automate the movement of files from one directory to another based on filename patterns and create a directory at the same time.

Files exists in SOURCE (PDF) that is 9+ characters long (i.e. 123456789 John Doe File.pdf
1L1345681 Jane Doe Flyer Type.pdf

I need to have the system scan all the files in the folder for the first 9 characters only.   (These are case files for our court).   From there I need it to scan the DESTINATION folder where it will look for the first 9 characters of ANY folder that is present, if it exists move the file(s) into that folder.  If it does NOT exist, create a new folder at the destination using ONLY the first 9 characters of the file and move ANY file that has those first 9 characters at the source into that destination.

Scenario 1:
123456789 ABC Court Case.pdf
123456789 DUI Trial Example.pdf
Folder on destination doesn't exist so create 123456789 on destination location and move ALL files that start with 123456789 to the new folder. 

Scenerio 2:
123456789 ABC Court Case.pdf
123456789 DUI Trial Example.pdf

Folder exists at destination called 123456789 John, Doe Case XYZ

Move all files that start with 123456789 to the 123456789 JOhn,Doe Case XYZ folder

-----------------------------------------
All of our files begin with 9 Characters which are the case numbers.  we need to move these into existing folders that ALSO start w/ these 9 characters (could include a letter but always 9 characters).  If the folder doesn't exist, create a folder matching the first 9 characters then move all files that start w/ those 9 to the newly created folder.  This needs to run 24x7 every 15 minutes.

We are hoping this software will work. if so, we are a customer :)


Title: Re: Automation of File Movement - Pattern based
Post by Gert on Aug 3rd, 2017 at 7:39am
Hi,

It sounds like you can easily do this using {dynamic naming}, see http://www.watchdirectory.net/wdhelp/plugins/dynamicname_functions.html

Use something like this for the target:
C:\Target\{left{9,{filetitle}}}\{filename}

{left{9,{filetitle}}} returns the first 9 characters of the filename

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.