How do I create a script that can move files to an existing directory based on filename?
Posted on 2010-08-20
Let me preface this by saying that I know nothing about computer programming.
I need a script that can pickup files from a dump folder (i.e, J:\ScanFiles\Fax dump) and move them to different folders (which already exist), based on the ID portion of the filename.
For example, a file in J:\ScanFiles\Fax dump would be named "1056_7_22_10.pdf" "1056" is the ID; note that this number could potentially be 6 figures or perhaps greater. So there could also be a "1056_7_23_10.pdf" etc. in Fax dump. These files should be moved to J:\ScanFiles\1056 This directory doesn't need to be created as it already exists.
So, as another example, a file in J:\ScanFiles\Fax dump named "51608_7_23_10.pdf" should be moved to J:\ScanFiles\51608 Again the destination directory already exists, the file just needs to be moved.
Thanks so much for your help!