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)
 Unzip a File in SSIS Package

Author  Topic 

Starlet_GT
Yak Posting Veteran

81 Posts

Posted - 2008-02-21 : 08:36:21
I want to unzip a file through "Execute Process Task".

For compressing(zip) a file i write the following.

In Process Tab:
In Executable: C:\Program Files\WinZip\WINZIP32.EXE
In Arguments: -min -a "C:\file.zip" "C:\file.mdb"

What arguments should i write to unzip a file?
And in case i want to copy a file from one location to another through Execute Process Task what should i do?

Please Help

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-02-21 : 08:44:01
To extract zipped file:

winzip32 -e sample.zip c:\somefolder


For copying file you can use regular COPY command:

Copy c:\somefile.txt c:\somefolder\


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

dineshasanka
Yak Posting Veteran

72 Posts

Posted - 2008-02-21 : 11:12:27
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=778806&SiteID=1

---------------------
http://dineshasanka.spaces.live.com/
Go to Top of Page

LOOKUP_BI
Constraint Violating Yak Guru

295 Posts

Posted - 2008-02-21 : 11:12:32
Hi There,

I am on the other side of the boat.
What would be the path to zip a file?
Go to Top of Page

Starlet_GT
Yak Posting Veteran

81 Posts

Posted - 2008-02-21 : 22:58:05
To zip a file do the following in "Execute Process Task".

In Process Tab:
In Executable: C:\Program Files\WinZip\WINZIP32.EXE
In Arguments: -min -a "C:\file.zip" "C:\file.mdb"
Go to Top of Page

Starlet_GT
Yak Posting Veteran

81 Posts

Posted - 2008-02-21 : 23:46:33
For copying a file i don't get how to do it ...

"For copying file you can use regular COPY command:
Copy c:\somefile.txt c:\somefolder\"

what should i write in the process Tab?
In Executable?
In Arguments?

please specify
Go to Top of Page

huffdawg
Starting Member

2 Posts

Posted - 2009-03-18 : 12:39:34
quote:
Originally posted by Starlet_GT

To zip a file do the following in "Execute Process Task".

In Process Tab:
In Executable: C:\Program Files\WinZip\WINZIP32.EXE
In Arguments: -min -a "C:\file.zip" "C:\file.mdb"




I completely understand this, but what if your input file (i.e. C:\file.mdb) is a variable (i.e. c:\file_mar_2009.mdb). How do you supply the variable in this instance.

Also, what if you want the zip file to be c:\file_mar_2009.zip basically using a variable to name the output zip file?

thanks
Go to Top of Page

nwillis
Starting Member

1 Post

Posted - 2009-11-23 : 16:43:23
I have followed these instructions in the Execute Process Task in SSIS. However when I run it, a WinZip window appears with a message that says 'Multiple files were dropped, and one or more is an archive. Add files to archive?. I don't want it to have a popup box at all....but even if I click on Yes or No.....the task ends successfully but it doesn't unzip the file. I've tried several versions of what to put in the argument - nothing works.
Go to Top of Page

pss
Starting Member

1 Post

Posted - 2010-09-15 : 17:36:20
quote:
Originally posted by nwillis

I have followed these instructions in the Execute Process Task in SSIS. However when I run it, a WinZip window appears with a message that says 'Multiple files were dropped, and one or more is an archive. Add files to archive?. I don't want it to have a popup box at all....but even if I click on Yes or No.....the task ends successfully but it doesn't unzip the file. I've tried several versions of what to put in the argument - nothing works.






quote:
Originally posted by nwillis

I have followed these instructions in the Execute Process Task in SSIS. However when I run it, a WinZip window appears with a message that says 'Multiple files were dropped, and one or more is an archive. Add files to archive?. I don't want it to have a popup box at all....but even if I click on Yes or No.....the task ends successfully but it doesn't unzip the file. I've tried several versions of what to put in the argument - nothing works.



I followed the same above process from the above posts and landed onto to the same message as you did. And the right thing to do and still succeed without the message is:

To extract zipped file:

In Process Tab:
In Executable: C:\Program Files\WinZip\WINZIP32.EXE
In Arguments: -e sample.zip c:\somefolder
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-09-23 : 13:28:02
quote:
Originally posted by huffdawg

quote:
Originally posted by Starlet_GT

To zip a file do the following in "Execute Process Task".

In Process Tab:
In Executable: C:\Program Files\WinZip\WINZIP32.EXE
In Arguments: -min -a "C:\file.zip" "C:\file.mdb"




I completely understand this, but what if your input file (i.e. C:\file.mdb) is a variable (i.e. c:\file_mar_2009.mdb). How do you supply the variable in this instance.

Also, what if you want the zip file to be c:\file_mar_2009.zip basically using a variable to name the output zip file?

thanks


you can expression builder to set the name property of your file at runtime

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

SSISJoost
Starting Member

9 Posts

Posted - 2011-01-04 : 16:41:28
Here is an example to unzip ZIP files (not gzip) with a script task:

http://microsoft-ssis.blogspot.com/2011/01/unzip-files-with-ssis.html

It uses the Microsoft Visual J# Redistributable Packages (vjslib.dll).

Go to Top of Page

Ashishj016
Starting Member

1 Post

Posted - 2011-03-17 : 18:42:22
its good example of unzipping,
i need to get the output file name.
i provided a StandardOutputVariable = @[User::OutputFileName] however i am not getting any data in this variable.
please give some idea.
Thanks


Ashish
Go to Top of Page

SSISJoost
Starting Member

9 Posts

Posted - 2011-03-18 : 02:47:25
quote:
Originally posted by Ashishj016

its good example of unzipping,
i need to get the output file name.
i provided a StandardOutputVariable = @[User::OutputFileName] however i am not getting any data in this variable.
please give some idea.
Thanks

Ashish


which example do you mean? Via the Execute Process Task or via the Script Task?
Go to Top of Page
   

- Advertisement -