将每周的Excel文件下载计划为唯一的名称 [英] Schedule weekly Excel file download to an unique name
问题描述
我们有一个数据库,每个星期一从客户端上载一个Excel文件.该文件始终是相同的名称,因此,如果我们忘记了它,则会丢失它.有没有一种方法可以使脚本重命名并为其指定日期或数字?
我们正在使用FileZilla现在获取文件.
FileZilla 不允许任何形式的自动化.
您可以使用以下 WinSCP脚本:
open ftp://user:password@host/
get "/path/sheet.xls" "c:\archive\sheet-%TIMESTAMP#yyyy-mm-dd%.xls"
exit
脚本连接到服务器,将工作表下载到本地存档中,其名称为sheet-YYYY-MM-DD.xls
.
有关详细信息,请参见:
然后在Windows调度程序中创建一个任务,以使用参数在每个星期一运行winscp.exe
:
/script="c:\path_to_script\script.txt" /log="c:\path_to_script\script.log"
记录(/log=...
)是可选的,但建议这样做.>
有关详细信息,请参见计划文件传输(或同步)到FTP/SFTP服务器.
(我是WinSCP的作者)
We got a database where every Monday a Excel file gets uploaded from a client. The file is always the same name so if we forgot it we lost it. Is there a way how we can make a script that renames the script and gives it the date or a number?
We're using FileZilla to get the files now.
FileZilla does not allow any kind of automation.
You can use this WinSCP script:
open ftp://user:password@host/
get "/path/sheet.xls" "c:\archive\sheet-%TIMESTAMP#yyyy-mm-dd%.xls"
exit
The script connects to the server, downloads the sheet to a local archive under a name like sheet-YYYY-MM-DD.xls
.
For details see:
- Automate file transfers (or synchronization) to FTP server or SFTP server
- Downloading file to timestamped-filename
Then create a task in Windows scheduler to run the winscp.exe
every Monday with arguments:
/script="c:\path_to_script\script.txt" /log="c:\path_to_script\script.log"
Logging (/log=...
) is optional, but it's recommended.
For details, see Schedule file transfers (or synchronization) to FTP/SFTP server.
(I'm the author of WinSCP)
这篇关于将每周的Excel文件下载计划为唯一的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!