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: 
Anonymous
Not applicable

Zipped Files as a Data Source?

I need to pull some files from an FTP that are in a zipped file.  Is it possible for QlikView to extract the csv's from a zipped folder?  I think the answer is no, but worth a shot on the forum here.

Or maybe there is a utility that can automatically unzip and extract data from an FTP.

8 Replies
rbecher
MVP
MVP

Hi Aaron,

I know that the CsvJdbc driver has this feature: http://csvjdbc.sourceforge.net

Maybe there are equivalent ODBC/OLEDB drivers. Or, you try our JDBC Connector.

Best regards,

Ralf

Astrato.io Head of R&D
Not applicable
Author

If the names of the files are fixed then u can write a batch command for copying and extracting the file, call the batch file in the qvd maker or run it through the scheduler and then load that file in Qlikview.

rbecher
MVP
MVP

Yeah of course, but this all needs extra time..

Astrato.io Head of R&D
Not applicable
Author

U can extract the file from the QVD maker itself using the execute command but i dont know if the file can be copied from the FTP server using the execute command.

rob_centrix
Partner - Contributor
Partner - Contributor

Hi there Aaron

I tried this and it works - Thanks to eHow

  • 1
    • Click "Start", "All Programs", "Accessories", "Notepad" to open Windows Notepad.
  • 2
    • Copy and paste the following VBS code into the Notepad window:

Function Unzip(strFileName,strFolderName)Dim objshellDim objfso

' Create Shell.Application so we can use the CopyHere method

Set objshell = CreateObject("Shell.Application")

' Create FileSystemObject so we can use FolderExists and CreateFolder if necessary

Set objfso = CreateObject("Scripting.FileSystemObject")

' Create folder to receive files if it doesn' t already exist

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

' Use CopyHere to extract files

objshell.NameSpace(strFolderName).CopyHere

objshell.NameSpace(strFileName).ItemsSet

objfso = NothingSet objshell = NothingEnd Function

'Put your own zip file name and folder name inside the quotes in the next line

Unzip "C:\Test\Test.zip","C:\Test\Testing"

  • 3
    • Edit the last line to substitute your own zip file name and folder name for the examples given inside the quotation marks. You can specify an existing folder or not. The script will create the folder if it doesn't already exist.
  • 4
    • Click "File", "Save As" to open the Save As dialog window. Type "extractzip.vbs" (without the quotes) in the "File Name" box. Select "All Files (*.*)" from the "Save As Type" drop-down. Click the "Save" button to save the new VBS file.
  • 5

          enter the following command in your Qlikview script editor:

                         execute cmd.exe /c "C:\Data\extractzip.vbs"

Anonymous
Not applicable
Author

Thanks for all the suggestions.  I ended up using a couple bat scripts and an unzip utility to accomplish this, and execute them in my QV script.  Thanks to everybody for their suggestions!

rbecher
MVP
MVP

Btw. we have developed a component which can read zipped CSV files (e.g. from a FTP server) and it provides this as a web source via URL to QlikView.. So you would not need to do any batch processing, just read the data as from a web source.

Astrato.io Head of R&D
Anonymous
Not applicable
Author

Well, the requirement ended up changing.  I ultimately had to extract from a network source so no FTP required. The only thing I needed to do was move the file for archiving and unzip it.

I would be interested in obtaining your component for future use (if it is free).

Best regards,

Aaron