Rename File Problem

  • Guys

    I just know this is a daft question, but it's driving me nuts!

    I am simply trying to rename a bunch of files in a for..each loop container.

    The source path is the variable that is mapped to the filename only during the loop (strFileProcessing)

    The destination path is an expression built from variables as follows:

    [p]@[User::strUnimportedFolder] +"\\"+@[User::strFileDate]+"_"+ @[User::strFileProcessing[/p]

    Where strUnimportedFolder is the folder where te source file resides and strFileDate is a variable that is set to the current date in ddMMyyyyhhmmss format earlier in the package.

    When the package runs, I get an error saying

    [File System Task] Error: An error occurred with the following error message: "The connection "C:\DBC Test\UnimportedFiles\04072011120000_bjcanex0" is not found. This error is thrown by Connections collection when the specific connection element is not found.

    ".

    Well, no, of course it doesn't exist because I'm trying to rename the file bjcanex0 (which definately does exist!)

    I have 'DelayValidation' set on both the file system task and the loop.

    I could do this really simply in a script task, but I can't believe I can't do it with the component that is designed for the task - what am I doing wrong? :crazy:

  • Are you sure you put the correct expression in the destination and that you've not accidentically switched the source and the destination around?

    I don't really see an issue in the situation you described, but I can't look into your package of course.

    (I usually work with the script component, they give me less headaches :-D)

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • (I usually work with the script component, they give me less headaches )

    With you on that one. Most of my packages consist of big chunks of VB!

    I've checked the source / destination and all seems to be in the right place.

    I've done it in 3 lines of VB, but I'm going to keep trying to get the file system task to work because it is (supposedly) the right way to do it

    I'll post back if I find the solution

    😀

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply