如何循环遍历ssis中的文件夹和文件
我有一个文件夹(主文件夹),其中可能有基于员工 ID ex(67,68,78,92.. 等)的子文件夹,这意味着员工 67,68,78 和 92 已经上传了一些 excel 文件到他们的文件夹。如何一一循环遍历所有子文件夹及其文件。
一开始,我只有主文件夹。我不知道哪个员工将上传特定月份的多少 Excel 工作表。
I have a folder let say (Main folder), which could have sub folders based on the employee id ex ( 67,68,78,92.. etc) which means that employee 67,68, 78 and 92 has uploaded some excel files to their folder. How can I loop through all sub folders and their files one by one.
In the beginning, I have only main folder. I am not aware that which employee is going to upload how many excel sheet for a particular month.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用“Foreach 循环容器”。双击它时,转到“集合”并选择“Foreach 文件枚举器”。一旦你这样做,它会要求包含文件的文件夹,在这里你必须选择你的主文件夹。然后您需要选中“遍历子文件夹”复选框,这样就可以了。
使用 Foreach 循环循环文件
You need to use the "Foreach Loop Container". When you double-click it, go to "Collection" and choose the "Foreach File Enumerator". Once you do that, it will ask for the folder that contains the files, here you have to choose your Main folder. Then you need to check the "Traverse subfolders" checkbox and that should do it.
Looping over files with the Foreach Loop