Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 File System Task Question

Author  Topic 

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2007-08-14 : 18:17:25
Is there a more clever way of doing this?

Currently I have to download a .gz file, uncompress and place it on a share with the current day's name (YYYYMMDD.txt).

This is how I'm doing this:

1 - FTP Task Manager to download file using expressions.
2 - Unzip file using a .bat file (Using 7zip). The uncompressed version of the file looks something like deedyyyy-mmddXXXXX.txt, where XXXXX is a bunch of numbers and letters that always changes, file version stamp from the vendor.
3 - Since I never know how the file is going to be called when I unzip it, I have to kick off another bat file to rename deedyyyy-mmddXXXXX.txt (*.txt) to 1.txt, then rename 1.txt to YYYYMMDD.txt, which is what I need for my ETL process.
4 - Archive zip file to another share
5 -Move YYYYMMDD.txt to another folder, so the ETL process can use it.

Basically, I'm not 100% sure about step 3, I'm renaming the files too many times and relying on bat files to do the job.

How would you guys handle such scenario? I'm not being able to use wildcards on File System Task.

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-14 : 22:36:18
Should be fine if the folder only contains that file, and don't even need to rename it twice.
Go to Top of Page

RossKo
Starting Member

1 Post

Posted - 2007-08-17 : 13:18:00

You might also try the File Task for the renaming of files.

-rkj
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2007-08-17 : 16:48:59
But I don't know what's the file is going to be called and I'm pretty sure I can't use wildcards when creating a file connection, unless I'm missing something.
Go to Top of Page
   

- Advertisement -