Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
felcar2013
Contributor II

FTP data import into script

hi

i need to import several zipped CSV files from a FTP Server into the script directly. Do you know how to do this?

there is an option, but i never used it (i also have no FTP Server connection yet, so i never tried)

thanks

felipe

1 Solution

Accepted Solutions

Re: FTP data import into script

Qlikview can't read zipped csv files. You either need to store the csv files uncompressed on the ftp server or you have to use an external tool like curl or wget to download the zip files, then use a script to unzip the files. Then Qlikview can load the uncompressed csv files.

edit: enable the Use FTP option under Data from Files to retrieve files via ftp

comm82827.png


talk is cheap, supply exceeds demand
13 Replies

Re: FTP data import into script

Qlikview can't read zipped csv files. You either need to store the csv files uncompressed on the ftp server or you have to use an external tool like curl or wget to download the zip files, then use a script to unzip the files. Then Qlikview can load the uncompressed csv files.

edit: enable the Use FTP option under Data from Files to retrieve files via ftp

comm82827.png


talk is cheap, supply exceeds demand
felcar2013
Contributor II

Re: FTP data import into script

thanks

the files are comming unzipped, we changed this.

using the ftp option from QV, is it possible to get access to unzipped files located in a ftp server and to bring them to the QV Application? Or do i need a macro, what i also have.

I cannot try now with accessing directly the ftp server since i need some credentials, which i do not have, but just wanted to know

thanks

felipe

Re: FTP data import into script

Try this: (with loop because wildcards don't work per ftp-load)

set ftp = 'ftp://USERSmiley TongueASSWORD@YOURSERVER.com/';PASSWORD@YOURSERVER.com/';

set datafile = 'YOURFILE';

set ext = '.csv';

set typCSV = "(txt, codepage is 1252, embedded labels, delimiter is ';', no quotes)";

for i = 0 to $(vCounter)

    let vZeitraum = date(AddMonths('01.02.2012', $(i)), 'YYYY_MM');

    table:

    Load *

    FROM $(ftp)$(datafile)$(vZeitraum)$(ext)$(typCSV);

next

- Marcus

felcar2013
Contributor II

Re: FTP data import into script

hi

thanks for the script, the vCounter should be the number of my datafiles in the ftp server, right?

Re: FTP data import into script

Yes, a simple counter:

let vCounter = ((year(today() - 1) - year('01.02.2012')) * 12) + (month(today() - 1) - month('01.02.2012'))

to generate a YearMonth-stamp for the loop.

- Marcus

praveenavelagap
Contributor III

Re: FTP data import into script

how can i create loop for every day? i want to load for everyday.. file is generated for every 1 min; deleted for 15days..

Not applicable

Re: FTP data import into script

What is the sample file name format

praveenavelagap
Contributor III

Re: FTP data import into script

csv 's

Re: FTP data import into script

Community Browser