Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Moving files based on creation date of parent file  (Read 2138 times)

0 Members and 1 Guest are viewing this topic.

CameronY

    Topic Starter


    Intermediate

    Moving files based on creation date of parent file
    « on: May 08, 2006, 11:09:11 PM »
    Hi all,

    Have been trying in vain to script the following and I'm running short of patience trying to work a solution.

    The problem...
    In the directory ~\Pending\ are the following files...
    2C5F8R
    2D4AIX
    2DPHF4
    2DQOMS
    2DT2CL
    2DZL2J [...plus another +1200 more]

    In another directory ~\Unprocessed\?????????\ are files with the naming convention of:
    XXXXXX_yyyymmddHHMMSS_duplicate [...there are thousands of them]

    Where:
    XXXXXX is reflective of the name found in the ~\Pending\ directory.
    yyyymmddHHMMS is reflective of the creation time stamp of this file.
    ????????? is the office ID entered by user.

    What is to be accomplished is the following ...
    1) Identify in the Pending directory files for a specific office ID
    2) Identify in the Unprocessed directory duplicate files for specific office ID that are duplicated (easy as the office ID is directory and duplicate will be in the file name)
    3) Do some database updates
    4) Move the files found in step 1 to the main download directory so that they can be reprocessed
    5) Move the files found in step 2 to the main download directory so that they can be reprocessed if there was a matching files (XXXXXX) in the Pending directory and the date created is after the date created for the file in the Pending directory.

    Have been trying to work this out for the last four days and sadly getting no where fast.  And I don't wish it upon anyone to do this task manually (!!).  It's [highlight]step five[/highlight] that is causing the biggest headache for me.

    Any help is appreciated.


    Sample data would be the following ...
    [size=10]** OID   = AKLPI3503    (Entered by user)
    ** Pending File = 2DQOMS   ( dir /tc /-c 2DQOMS* )

    05/04/2006  10:38              725 2DQOMS

    ** Checking for 2DQOMS related items in ~\UnProcessed\?????????\ ..   ( dir /tc /-c 2DQOMS* )

    05/04/2006  10:35             2200 2DQOMS_20060405114049_duplicate
    05/04/2006  11:49             2005 2DQOMS_20060405114931_duplicate
    06/04/2006  10:21              383 2DQOMS_20060406102111_duplicate
    [/size]

    DosItHelp



      Intermediate
      Re: Moving files based on creation date of parent
      « Reply #1 on: May 11, 2006, 07:57:50 PM »