Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
felcar2013
Partner - Creator III
Partner - Creator III

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
Gysbert_Wassenaar

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

View solution in original post

13 Replies
Gysbert_Wassenaar

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
Partner - Creator III
Partner - Creator III
Author

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

marcus_sommer

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

set ftp = 'ftp://USER:PASSWORD@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
Partner - Creator III
Partner - Creator III
Author

hi

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

marcus_sommer

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

Anonymous
Not applicable

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

What is the sample file name format

Anonymous
Not applicable

csv 's