Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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');
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.
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
you can map it to a drive LETTER with 'FTP DRIVE' http://www.killprog.com/fdrve.html AND THEN REDO