How to delete contents of a flat file

  • I have a package that creates a flatfile. then it begins a process with the information on the file, and at the end of the Package, the flatfile gets deleted.

    If for some reason there is no information to process, the file does not create (which is fine...), however the package errors out when it trys to open the file, because it does not exist.

    I need to make it, so the package does not fail... it simply ends the process.

    I am thinking I need to figure our how to do 1 of two things

    1. Do not delete the file at the end of the process, but delete the contents of the file, so the file always exists

    or

    2. Create an empty file if there is no information to process

    I have been looking around to find out how to implement either solution but I have not been able to figure it out

    Any ideas anyone?? I would really appreciate it!

  • I would go with option 3.

    At the beginning of the process, if the file does not exist, create one.

    You can create an empty file through the command line, via a script component, or by simply copying a blank "template" file from another location.

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

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