将每周的Excel文件下载计划为唯一的名称 [英] Schedule weekly Excel file download to an unique name

查看:75
本文介绍了将每周的Excel文件下载计划为唯一的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个数据库,每个星期一从客户端上载一个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:


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆