Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

FTP iteration to pull and load files

Hi all,

I've been trying to work out how to log into a FTP server using QV, iterate through all the files on the server using a QV script

and pull in files with a creation date greater than the last time the script searches for the file...

So far I've got this far (straight from the QV documentation almost!) using a subroutine which is able to read files from a directory (or in this case just read the names of the files in the directory) on the local machine... However I want to be able to do this via FTP:

sub DoDir (Root)

for each File in filelist (Root&'*.csv' )

Load

'$(File)' as Name,

FileSize('$(File)') as Size,

FileTime('$(File)') as FileTime

autogenerate 1;

next File

end sub

call dodir('c:\temp\*.csv');

How would I do this? I changed the DoDir ROOT parameter to ftp://username:password@ftpservername.com/*.* but it doesn't work...
I also tried to use the Directory statement to point to the same link but it didn't work either...
Thanks,
Davydd

3 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Hi Davydd, I think we discussed this before here: http://community.qlik.com/forums/p/25480/97295.aspx#97295

Still no success?

I am not sure if you can read directly from FTP directories. I would rather have a batch file which will download the file and then load these files. You can call this batch file in a loof of the script using EXECUTE for each file or as a first step for downloading all the files in a directory first.

Other options would be to look for some utility program which would let you map FTP directories as local drive (like Y:) on your PC.

Not applicable
Author

Hey Rakesh

Thanks for replying - yep still no success - I'm trying to work out if indeed it is posisble in QV to do this without using external scripts - but it seems it may not be!

If I can't do it through QV I will definitely do what you suggested about the FTP program or batch file.

Thanks again

Davydd

Not applicable
Author

you can map it to a drive LETTER with 'FTP DRIVE' http://www.killprog.com/fdrve.html AND THEN REDO