the above screen has 4 folder and Outer folder BP41693 i need to read to get the File count inside all the 4 folders . there are N no of PDF files in the above 4 folders.
below logic is not working . How to get count of files inside 4 folders.
Directory.GetFiles(“Data\Downloading_files\BP41693”).Count
rikulsilva
(Henrique Lima da Silva)
November 27, 2023, 1:54pm
2
Hi @shashank_dullu
Try this
Directory.GetFiles("Data\Downloading_files\BP41693","*", SearchOption.AllDirectories).Count
The * is a wildcard tha you can use for filter file by extension, name etc
*.pdf
*.xlsx
*.txt
*.csv
invoice*.pdf
*2023.xlsx
* alone = all files
2 Likes
@shashank_dullu
directory.GetFiles("C:\Users\cogni\Downloads\userforum","*.pdf",SearchOption.AllDirectories).Count
if they are pdf files use this
for any type of files you will get the count which is given by @rikulsilva
1 Like
AJ_Ask
November 27, 2023, 2:15pm
4
For Pdf Count inside all the folders
directory.GetFiles(“Data\Downloading_files\BP41693”,“*.pdf”,SearchOption.AllDirectories).Count
system
(system)
Closed
November 30, 2023, 2:16pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.