8 Replies Latest reply: Oct 12, 2012 9:36 AM by Aaron Couron RSS

    Zipped Files as a Data Source?

    Aaron Couron

      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.

        • Re: Zipped Files as a Data Source?
          Ralf Becher

          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

          • Re: Zipped Files as a Data Source?

            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.

            • Re: Zipped Files as a Data Source?

              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.

              • Re: Zipped Files as a Data Source?
                Rob M'Crystal

                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"

                • Re: Zipped Files as a Data Source?
                  Aaron Couron

                  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!