February 7, 2014 at 8:58 am
I have a Primary Folder, I'll call it C:\LOAD for simplicity. In most of the packages, I only load one flat file into the "LOAD" folder, then delete it. Easy Peasy. But sometimes I have one where they send me lots of files, in lots of folders. It's tooooo cumbersome to grab each file from each folder (can be 50 or more) and drop just the file in the Load folder. Not to mention that the files often have the same name.
I can set the ForLoop containers to iterate through the subfolders just fine and bring in all the files. But I now want to delete all that stuff from the Load folders, including the subfolders and their contents. All this happens on a scheduler at 2am so I'm not going to stick around and delete the stuff.
I have the File System Task Container in a ForEachLoop Container.
Config--
ForEach Loop Editor: Enumerator = ForEach File Enumerator
Folder = C:\Load
Files: = *.*
Retrieve File Name: "FUlly QUalified" radio button selected.
Variable Mappings
USER::StrFile INDEX = 0
Expressios - Nothing config'd.
FileSystem Task Container: Operation = Delete Directory
IsSourcePathVariable = True
SourceVariable = USER::strFile
I can delete the individual text files from the folders, but not the folders. I'm certain I've build one to delete folders as well, but can't seem to make it work now.
Any help is appreciated.
Thanks
Crusty.
February 7, 2014 at 9:18 am
I always find the forfiles command useful in these instances...
February 7, 2014 at 9:22 am
Sorry dude... but I have no idea how to use that in a DTSX package... I scanned through it, but I'm going to have to interpret and apply it. I"m thinking I've forgotten to do something in my setup of the File System Task, but I can't figure out what it is.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply