Read pdfs from subfolders

Hello Friends,
I am able to read all pdfs from folder but in one folder(“March”) have subfolder(“1,2,3”) and inside pdf available which we need to read.

How can we read that folder and subfolder as well along with all.

I am using REFRAMEWORK. Sample data uploaded.

Thanks in advance
PDF read.zip (280.9 KB)

@Jeeru_venkat_Rao,

Use this LINQ to get all pdf including sub directories

fileList = Directory.GetFiles("March", "*.pdf", SearchOption.AllDirectories)

Hi @Jeeru_venkat_Rao ,

You can use “For each file folder” Activity from Activity Panel and check the box “Include sub folders”. Please let me know, if this works. Refer below screenshot for reference. Happy Automation!

I am using For each file in folder and it is working for sub folders but in my scenario
Main folder have 4 folders(JAN,FEB,MAR,APR) all folders have already sub folder like “ProcessPDF” and in that folder have some pdfs but in MAR folder have sub folders(1,2,3) and in each of them have “ProcessPDF”. Bot is working good but when it comes to MAR it failed.

Hi @Jeeru_venkat_Rao

You can try using the “For Each File in Folder” activity inside a “For Each Folder in Folder” activity. This will ensure that files inside subfolders of the March folder are also read.