Loading .txt files daily from a different folder

Answered Loading .txt files daily from a different folder

  • Sunday, November 25, 2012 1:16 AM
     
     

    Hey,

    I have a directory(Main), in that there is a folder (Sub), which has further subfolders (e.g. 20120101,20120202,20120303,20120404..etc). What I need to do is, get the .txt files from Date1,Date2,Date3,Date4..etc respectively and load them daily in to my SQL table. Is there any way to accomplish this? 

    E.g. The package that will run tomorrow morning (11/25/2012) will load the text file from yesterday (20121124). For my testing purposes, I want to load all the text files from these folders in my package.

All Replies

  • Sunday, November 25, 2012 1:44 AM
     
     
    Just click the traverse subfolders checkbox in your for each file task.

    Chuck Pedretti | Magenic – North Region | magenic.com

  • Sunday, November 25, 2012 3:04 AM
     
     
    One more thing, i would like to add is: Once I have processed those files, I would like to add them to another folder (Archive). How can this be done?
  • Sunday, November 25, 2012 2:02 PM
     
     Answered
    You would use a file system task after your data flow task and set the action to Move file

    Chuck Pedretti | Magenic – North Region | magenic.com