+ Reply to Thread
Results 1 to 3 of 3

Archiving Files - Creating New Folders and Moving Files

  1. #1
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Archiving Files - Creating New Folders and Moving Files

    Hi,

    Im wondering if anyone can help.

    I have a shared server that a large number of XML files are sent to on a daily basis. I run a process at the end of each day to summarise these files, however, as part of this process I would also like to archive them based on their date.

    The server path is I:\Messages\

    The filename is made up of the below:

    I have highlighted the date part in red. The remainder of the filename to the right of the red is a timestamp and then counter.

    Brian_Example_20110516155242_000024

    What I would like to do is archive these files based on Year and then Month.

    So for example the above file would have the folder 2011 created if it does not already exist and then create the folder 05 - May if that does not already exist. The file would then be moved to this folder.

    So the final filepath would become:

    I:\2011\05 - May\Brian_Example_20110516155242_000024.xml

    Year folders made up in format YYYY and Month Folders made up of the month number "-" and Month Name. 05 - May for this month.

    Thanks in advance.

    McC
    McCrimmon

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2007
    Location
    England
    MS-Off Ver
    Office Pro Plus 2021
    Posts
    424

    Re: Archiving Files - Creating New Folders and Moving Files

    Hi Mc Crimmon,

    The sub directory 2011 and sub directories 01 - 12 for the months would need to be set up in advance.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Re: Archiving Files - Creating New Folders and Moving Files

    Hi,

    Thanks for your response. Much appreciated.

    All of these are XML files.

    There can be a great number of files that need archived at any one time so needs to be a quick looped process without actually opening the files.

    I do not like the idea of having to create the directories etc as this should be an automated process and adds no benefit as would be quicker just copying the files over manually.

    Does anyone else have any suggestions?

    Thanks

    McC

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1