Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Export Multiple Zipped Files Using WinRAR

How can I export multiple zipped files using WinRAR in QlikView..... Need help on this...

1 Solution

Accepted Solutions
agomes1971
Specialist II
Specialist II

Try this

Function Unzip(strFileName,strFolderName)
Dim objshell
Dim objfso

Set objshell = CreateObject("Shell.Application")

Set objfso = CreateObject("Scripting.FileSystemObject")

If Not objfso.FolderExists(strFolderName) Then objfso.CreateFolder strFolderName

objshell.NameSpace(strFolderName).CopyHere

objshell.NameSpace(strFileName).ItemsSet

objfso = NothingSet objshell = NothingEnd Function

Unzip "C:\Users\Shailesh Kumar\Desktop\Test\UAE iAgentByApplicationState Dump - 2015-01-05.zip","C:\Users\Shailesh Kumar\Desktop\Test"

View solution in original post

9 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Do you mean to export data from QlikView into QVD's or CSV files and compress them into a rar archive? From the Load script?

Peter

Not applicable
Author

Hi Peter .. thanks for the quick reply...

But I want to load data directly from ZIP file or something that can automatically extract CSV files from ZIP and store in a specific folder... So that I need not to manually export CSV from ZIP every time...

Hope I am able to explain my requirement....

agomes1971
Specialist II
Specialist II

Hi,

hope this helps...

Zipped Files as a Data Source?

Regards

André Gomes

Not applicable
Author

Hi Ande Gomes,

I have tried the below script but getting an Error....

--------------------------------------------------------------------------------------------

Error: Expected end of statement'....

Code: 800A0401

--------------------------------------------------------------------------------------------

Function Unzip(strFileName,strFolderName)Dim objshellDim objfso

Set objshell = CreateObject("Shell.Application")

Set objfso = CreateObject("Scripting.FileSystemObject")

If Not objfso.FolderExists(strFolderName) Then objfso.CreateFolder strFolderName

objshell.NameSpace(strFolderName).CopyHere

objshell.NameSpace(strFileName).ItemsSet

objfso = NothingSet objshell = NothingEnd Function

Unzip "C:\Users\Shailesh Kumar\Desktop\Test\UAE iAgentByApplicationState Dump - 2015-01-05.zip","C:\Users\Shailesh Kumar\Desktop\Test"

Not applicable
Author

this error is on Line: 1 and Char: 58

agomes1971
Specialist II
Specialist II

Try this

Function Unzip(strFileName,strFolderName)
Dim objshell
Dim objfso

Set objshell = CreateObject("Shell.Application")

Set objfso = CreateObject("Scripting.FileSystemObject")

If Not objfso.FolderExists(strFolderName) Then objfso.CreateFolder strFolderName

objshell.NameSpace(strFolderName).CopyHere

objshell.NameSpace(strFileName).ItemsSet

objfso = NothingSet objshell = NothingEnd Function

Unzip "C:\Users\Shailesh Kumar\Desktop\Test\UAE iAgentByApplicationState Dump - 2015-01-05.zip","C:\Users\Shailesh Kumar\Desktop\Test"

Not applicable
Author

thanks its working fine....

agomes1971
Specialist II
Specialist II

Great!!! 😉

Anonymous
Not applicable
Author

Try this

Sub TestRun()

    'Change this as per your requirement

    Call UnZip("folder to export the files","Zip file full path")

    Call UnZip("D:\New\UNZIP", "D:\New Resume\fwd.zip")

End Sub

Sub UnZip(strTargetPath, Fname)

    If Right(strTargetPath, 1) <> "\" Then

        strTargetPath = strTargetPath & "\"

    End If

    FileNameFolder = strTargetPath

    Set oApp = CreateObject("Shell.Application")

    oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(Fname).items

End Sub

Regards

Harsha