My company´s data department uploads a .csv
file daily to a remote folder that I can only access through my company's network using FileZilla.
Everyday, I use the newest .csv
file and process the data in R. I want to automate this process. I want to access the daily .csv
file by reading the .csv
file from the remote folder using the read.csv
function in R.
How can I tell FileZilla to copy the file in the shared folder to a local folder in my PC and do this everyday at 6:00 a.m.? If this isn't possible, how can I access the remote folder through R and read the .csv
file from there?
Thanks in advance!
EDIT:
As seen here, FileZilla does not allow any sort of automation. You can use the client WinSCP
instead, write a script to download/upload files from/to a remote SFTP server and schedule the script to run every n days using Windows Task Scheduler
.
Now, in order to access an SFTP server from R, you can use the RCrul
package. Unfortunately, this closed question (which was closed because it was not even a question to begin with) purges unwanted lines of code from an FTP
server (even though the title says SFTP
) and it doesn't specify the user, password nor port specs. Moreover, it uses the write.lines()
command, which as I understand, is used to create, not download files.
This question specifically refers to downloading a .csv
file from a shared folder using SFTP
protocol. Given that FileZilla is no good for this, how can I manage to do this in R using RCurl
?