Automatic re-naming of files depending upon criteria

  • Hi


    Was wondering if any of you guys know if the below is possible and how to go about it.


    The scenario is that files (CSV's) are sent (Email) to me from a number of different sources. Source A, B, C, & D. These file names are all formated differently, so for example from source A the file name will always be AB(+variable data), from source B it will always be BGHJ(+variable data) etc. I need then to recognize the fixed data e.g. AB or BGHJ and change the file name to something that I need - so AB(+variable data) could become ABNEW(+variable data) and BGHJ(+variable data) could become BGHJNEW(+variable data) - these are then saved to a specified destination.


    Does this make sense? Thanks for reading - any ideas / suggestions / questions gratefully received


    Cheers
    Bertie

  • Re: Automatic re-naming of files depending upon criteria


    Bertie,


    I think I know what you are wanting. You state the each file name will contain variable data

    Quote

    (+variable data)

    .


    Here is the method that I would use.


    1. Create a specific folder for the data files to be saved to. ( no other data files at all )
    2. Then open the files that contain the fixed identifiers

    Quote

    AB, BGHJ, etc.


    3. Once the file is open ( or you could use the rename/movecopy methods as well ) do a saveas with the new desired file name and location.
    4. Then delete that file from the incomming folder.



    Loop through steps 2,3,4 until all files are gone.

  • Re: Automatic re-naming of files depending upon criteria


    Thanks so much. Will give your suggestion a whirl, see what you're saying and think that it could work.


    Thnaks again
    Bertie

  • Re: Automatic re-naming of files depending upon criteria


    Bertie,


    Well if you're still stuck. Just come on back and we'll work on it some more.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!