Deleting empty files using ForEach loop container

  • I have a package that is building MANY flat files. Once the files are built, I would like to use a ForEach loop container, and delete ONLY the empty files. The package will produce both files with data and empty files. Can I do this in a ForEach? Thank you.

  • Yes, do a ForEach Loop container, choosing the Foreach File Enumerator - then use a script to detect the size of the file - You'll probably need a variable or two to keep the filename while iterating through the loop

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • Thanks for your reply! Can you help me with the script and the step-to-step on how to complete this? I am a biginner, and things look daunting! Thanks.

  • Unless there's a reason you can't, please attach what you've accomplished so far - and we can go from there?

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • I'm sorry to say that we haven't done anything on this yet! We have an SSIS package that produces 86 output files, and learned too late that we could have tested each file before building it! We don't have the time to go back and add the row count decision to each of the 86 output files, and thought that the ForEach process sounded like an easy solution! It probably is, but we can't figure it out. As I said, we are beginners at this! Thanks again for you reply.

Viewing 5 posts - 1 through 4 (of 4 total)

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