Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I have text files in the FTP link.I have loaded file by enable use FTP function.My files are
1) plant1_10_9_2017_fifo.txt
2) plant 2_23_10_2017_age.txt. vice versa.
we have 10 plants and multi programs.The date is based on the transcation.How can i get plant and dates from this file.* function is not working in ftp.please give some other ideas.Its very urgent.
Thanks in advance.
Could you please post the script where you tried..
And, I'd that files are stored as uncompressed? Because, using FTP connection May be zip files won't work
My script is,
LET vDt = chr(39)& date(today(1),'DD_MM_YYYY') & chr(39);
SET Errormode =0;
For each i in 'plant1','plant3','SOU4_p1','SOU2_p1','SOU1_p1',,'plant5'
For each j in $(vDt)
Age:
Load *,
FROM
[ftp://quser:Ql%21cK@90.180.1.7/textfile/$(i)_$(j)_AGE_.txt]
(txt,codepage is 1252, no labels, delimiter is ';', msq);
Next j
Next i
The loop is not working.Also i am confused about the date .
The FTP protocol does not support FileList() or wild card loads. This is an FTP limitation, not a Qlik thing.
You can extract a directory listing from the FTP site (eg to a text file) and then load and loop over the directory listing to load the files.
Dear jonathan,
I did to view ftp site in fie explorer manually,I am not aware of Extract a directory listing from the FTP site automatically.Could please help me
Thanks
You'll need an external batch file to run an FTP client, and send the command 'ls'. I can't remember the details, I last used FTP myself more than 5 years ago.
Google FTP for more information
Hi,
Try this code, using Batch File.,
Save your text files in your location from FTP server, then extract into Qlik.
**************************************************************
net use \\90.180.1.7\textfile 1234567 /USER:ABCDEF
copy /y "\\90.180.1.7\textfile\*.txt" "C:\New Folder"
**************************************************************
E.g.
FTP PATH - Location of your files (\\90.180.1.7\textfile)
PASSWORD - Provided Password (1234567)
USERNAME - Provided Username (ABCDEF)
DESTINATION PATH - C:\New Folder
An alternative method to Jonathan's suggestion could be to create an FTP script file with commands to transfer every file whose name starts with 'plant' and ends with '.txt' to a local directory.
I just found out that the ftp client on Windows Server 201x supports scripts files. I don't have an ftp server available to test this, but a possible script file would contain:
open IPAddress
user Username
pwd Password
lcd LocalDirectoryToReceiveFiles
cd RemoteDirectoryToGetFilesFrom
mget plant*.txt
quit
Replace all names in italics with proper values that work for you.
Launch a shell command via the script EXECUTE statement and include the script file after as parameter of a -s: command line option. Type ftp /? in a Command Prompt window to get more information about options.