将每周 Excel 文件下载安排为唯一名称

编程入门 行业动态 更新时间:2024-10-18 14:26:21
本文介绍了将每周 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.

详情见:

  • 自动将文件传输(或同步)到 FTP 服务器或 SFTP 服务器
  • 下载文件到时间戳文件名

然后在 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 文件下载安排为唯一名称

本文发布于:2023-11-08 20:21:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1570359.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:名称   文件   Excel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!