cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
chadw
Level II

How to create a JMP script that pulls data from multiple directories using FTP?

Hello,

I am trying to create a JMP script that would connect to an FTP server and then pull in datasets from multiple directories.  Using the File > Open Internet, I have been able to connect to the FTP server and view it as a web page but I am limited to only the Home directory.

So my question is, is it possible to create a JMP script that connects to an FTP server and then navigate to pre-defined directories to pull in data?

Thanks for the help!

1 ACCEPTED SOLUTION

Accepted Solutions
jara95
Level III

Re: How to create a JMP script that pulls data from multiple directories using FTP?

If your JMP program runs in Windows, you can create the FTP script and run it using JSL.

Below the JSL example copies all files having names starting with FILE_NAME in the FTP directory using mget command.

ftp_txt="

\!nopen 192.168.1.10

\!nuser FTP_USER_ID PASSWORD

\!nftp

\!ncd FOLDER/LOCATION/

\!nlcd C:\LOCAL\FOLDER

\!nprompt

\!nmget FILE_NAME*

\!nbye

\!n

";

save text file("c:\test.ftp",ftp_txt);

cmd_txt = "ftp -v -n -s:c:\test.ftp";

save text file("c:\jmp_ftp.bat",cmd_txt);

wait(1);

open("c:\jmp_ftp.bat");

View solution in original post

3 REPLIES 3
jara95
Level III

Re: How to create a JMP script that pulls data from multiple directories using FTP?

If your JMP program runs in Windows, you can create the FTP script and run it using JSL.

Below the JSL example copies all files having names starting with FILE_NAME in the FTP directory using mget command.

ftp_txt="

\!nopen 192.168.1.10

\!nuser FTP_USER_ID PASSWORD

\!nftp

\!ncd FOLDER/LOCATION/

\!nlcd C:\LOCAL\FOLDER

\!nprompt

\!nmget FILE_NAME*

\!nbye

\!n

";

save text file("c:\test.ftp",ftp_txt);

cmd_txt = "ftp -v -n -s:c:\test.ftp";

save text file("c:\jmp_ftp.bat",cmd_txt);

wait(1);

open("c:\jmp_ftp.bat");

chadw
Level II

Re: How to create a JMP script that pulls data from multiple directories using FTP?

Thanks for this solution jara95!  It is kind of round-about way of going about it, but it definitely works.

Craige_Hales
Super User

Re: How to create a JMP script that pulls data from multiple directories using FTP?

JMP 11 has another way to use programs like FTP, see this post on the RunProgram function which lets you control command line programs by sending them commands from JSL and reading their output with JSL.

Thanks to jara95 for the hint on the FTP options and commands...I needed that.

Craige