Need Help:To know new files in Folder

  • Hi Guys

    I need help in creating package. First i will explain the scenario.

    I have two folders Folder A,Folder B

    So the Initial Flat Files are stayed in Folder A

    The File format is like this Roger.07202010_085028.Ricky_Done.TXT

    So the new file comes every day in format of Roger.07212010_085028.Ricky_Done.TXT

    So first is task is need to Copy the new files from Folder A to Folder B.....I cant delete or Move in Folder A....when each time the new file comes in to Folder B i need to populate in table

    So Now my Question is I can use ForEachLoop Task grabing files in Folder A and copy to Folder B using File System Task...When the new file comes how can the foreach loop knows this is the newfile...beacause all the old files will stay in the FolderA itself.....

    Only thing that changes in the filename is datepart.

    I may not run the package daily....so it must know all the files which are not populated in table....

    One more thing is i am populating filename dynamically in table in Filename column using an variable.

  • get all files using system.io

    compare modified date, take latest file into variable

    loop thru all files..

    import that file..

    OR

    Each time you process a file, save the file name in database

    loop thru all files, check gainst table , were the file processed or not

    if processed then leave that file

    if not processed , process that file

    this works if u have multiple files which are new...and to be processed...

    cheers

  • You might want to use Konesans File watcher object http://www.sqlis.com/post/file-watcher-task.aspx

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

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