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

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

问题描述

我们有一个数据库,每个星期一都会从客户端上传一个 Excel 文件.该文件始终具有相同的名称,因此如果我们忘记它,我们就会丢失它.有没有办法我们可以制作一个脚本来重命名脚本并给它日期或数字?

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?

我们现在使用 FileZilla 来获取文件.

We're using FileZilla to get the files now.

推荐答案

FileZilla 不允许任何类型的自动化.

FileZilla does not allow any kind of automation.

您可以使用这个 WinSCP 脚本:

open ftp://user:password@host/
get "/path/sheet.xls" "c:archivesheet-%TIMESTAMP#yyyy-mm-dd%.xls"
exit

脚本连接到服务器,将工作表下载到本地存档,名称为 sheet-YYYY-MM-DD.xls.

The script connects to the server, downloads the sheet to a local archive under a name like sheet-YYYY-MM-DD.xls.

详情见:

然后在 Windows 调度程序中创建一个任务以每周一运行 winscp.exe 并使用参数:

Then create a task in Windows scheduler to run the winscp.exe every Monday with arguments:

/script="c:path_to_scriptscript.txt" /log="c:path_to_scriptscript.log"

日志记录(/log=...) 是可选的,但建议使用.

Logging (/log=...) is optional, but it's recommended.

有关详细信息,请参阅安排文件传输(或同步)到 FTP/SFTP 服务器.

For details, see Schedule file transfers (or synchronization) to FTP/SFTP server.

(我是 WinSCP 的作者)

这篇关于将每周 Excel 文件下载安排为唯一名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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