SSIS

  • Have several files with different names in a directory with a date added to the end of the files each month. I want to remove the dates from the end of the files using SSIS.

  • To get you started, you'll want to use a ForEach container and the FileSystem task. Exactly how you would use them, I don't know off the top of my head.

    😎

  • Use a ForEach loop container to loop through all the files in the specified folder, place a File System Task inside the ForEach container and use the Rename file operation. Then use expressions in the File System Task to generate your new file names without dates.

  • Hi,

    My problem is that the source file comes monthly with a date in the name and each month it will be diffrent. I need to get the file without the date...

  • Thats where expressions will come in handy, you can build up the filename as required.

    Something like this:

    "FileName" + (DT_STR, 4, 1252) YEAR(GETDATE()) + (DT_STR, 2, 1252) MONTH( GETDATE()) + ".txt"

    Then once you have located the file you can do the same to get rid of the date in the name.

  • Thanks.... will give it a try:)

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

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