Discussion Board for collaboration on QlikView Scripting.
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.
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.
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.
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.
Hi there Aaron
I tried this and it works - Thanks to eHow
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
objfso = NothingSet objshell = NothingEnd Function
'Put your own zip file name and folder name inside the quotes in the next line
enter the following command in your Qlikview script editor:
execute cmd.exe /c "C:\Data\extractzip.vbs"
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!
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.
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).