简体   繁体   English

如何在批处理FTP中管理以数字开头的文件

[英]How to mget files starting with a number in batch FTP

I have a batch file that gets files via FTP. 我有一个通过FTP获取文件的批处理文件。 I'm able to "mget *", but I only want files that start with any number of numbers, followed by an underscore and then C. 我能够“获取*”,但是我只希望文件以任意数量的数字开头,然后是下划线,然后是C。

I have: mget [0-9]*_C* 我有:mget [0-9] * _ C *

so, for example, I want to get the file: 01234_C.TXT, but I don't want S01234_C.TXT 因此,例如,我要获取文件:01234_C.TXT,但我不希望S01234_C.TXT

what's the syntax for getting a file that starts with numbers? 获取以数字开头的文件的语法是什么?

FTP doesn't support regular expressions. FTP不支持正则表达式。

You would have to log an ftp session and get a list of the files, process that list locally and then create another script to get every file that matchs your filespec. 您将必须登录ftp会话并获取文件列表,在本地处理该列表,然后创建另一个脚本以get与filespec匹配的每个文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM