FTP上存在计数文件数 [英] Count number of files exist on FTP

查看:145
本文介绍了FTP上存在计数文件数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用SSIS计算FTP文件夹中存在的zip文件数。引导我找到存在的文件数量。



我尝试了什么:



我曾尝试使用C#代码。

但是它不起作用

How do i count number of zip files present on FTP Folder using SSIS. Guide me to find the number of files present.

What I have tried:

I had tried with C# code.
But its not working

推荐答案

没有用于仅列出特定文件的FTP命令使用掩码。



所以你必须从目录中检索所有文件(例如使用FTP LIST 命令),过滤响应(删除所有不包含.zip的行),并计算剩余行数。



WinSCP 您可以使用脚本模式(或在命令行上传递FTP命令)并将输出写入日志文件(请参阅命令 - 行选项:: WinSCP [ ^ ])。然后处理该日志文件以获取所需信息。





以上关于 WinSCP 的块已经编写,因为最初的主题是使用WINSCP访问的FTP上存在的文件数量。但OP改变了主题。

[/ EDIT]
There are no FTP commands for listing only specific files using a mask.

So you have to retrieve all files from a directory (e.g. using the FTP LIST command), filter the response (remove all lines that does not contain ".zip"), and count the number of remaining lines.

With WinSCP you can use the scripting mode (or pass FTP commands on the command line) and write the output to a log file (see Command-line Options :: WinSCP[^] ). Then process that log file to get the required information.


The above block about WinSCP has been written because the initial subject was "Count number of files exist on FTP accessed using WINSCP". But the OP has altered the subject.
[/EDIT]


这篇关于FTP上存在计数文件数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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