hey everyone,
so i want to get the number of files that are in a specific folder (and all it’s subfolders).
i get that by using this.
is there also another way to get this answer without using “get folder info” activity?
kind regards!
hey everyone,
so i want to get the number of files that are in a specific folder (and all it’s subfolders).
i get that by using this.
is there also another way to get this answer without using “get folder info” activity?
kind regards!
Yes we can use expressions like this
Using assign activity
arr_filepath = Directory.GetFiles(”your main folderpath” ,”*.*”, SearchOption.AllDirectories)
Where arr_filepath is a variable of type type array of strings
Cheers @muehlbauer157
Hi,
You can use this
in assign activity
Int_Count = System.IO.Directory.GetFiles(“yourFolderPath”,“.”,searchOption.AllDirectories).Length
Can you try with this expression
Directory.GetFiles(Environment.CurrentDirectory+"\Input\","*.*",SearchOption.AllDirectories)
SearchOption.AllDirectories - Used for searching all the directories in the mentioned folder path
Regards
Gokul
- Assign (folderPath = "C:\YourFolderPath")
- Assign (fileCount = 0)
- Invoke Code
- Code:
```
Directory.GetFiles(folderPath, "*", SearchOption.AllDirectories).Count
```
- Result: fileCount
- Now, the fileCount variable contains the count of files in the specified folder and subfolders.
Hope it helps
this works thanks!
Can u click on activity and share the error that shows as a pop up
@muehlbauer157
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.