Execute Process Task Unzipping .gz files monthly
I have a monthly .txt.gz file dump thats zipped in .gz format. Each month the name changes to reflect the month and year. I've been trying to build a process to unzip the file and import the txt into a SQL table. Is there a way to automate the entire process? I currently use 7zip monthly to unzip and manually import, however I'm fairly certain SISS should be able to handle it.
July 19th, 2011 6:24pm

Yes, it can. You can use a Foreach Loop Container to loop over the (one) file you happen to have in a certain folder. Inside the loop, that'll place the filename into an SSIS variable. You can then use an Execute Process Task to issue your 7zip command to extract the contents, and then process the contents... Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2011 7:49pm

example of decompressing gzip file here: http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx To get the file name you can use either code or SSIS expressions based on either current date or (my preferred approach) log the last file that was used in a metadata table in your db - use that to determine what the next file should be namedRgds Geoff
July 19th, 2011 11:56pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics