Take files under subroot folder

Hi Friends,
I have one shared path and here is the folder hierarchy:-
main folder path (C:\xyz )–> containing 2 folder (Folder 1 and Folder2) ---->containing 2 folders (Account and Department) --> and below that folder there are some files in both folder i.e (Account and Department)- e.g abc.txt , cde.txt

Now i want to read only abc.txt and cde.txt files from both the folder i.e (Account and Department)

Here if i used directory.getfiles(“path”,"*.txt",searchoption.alldirectory)
then it return all the files from all folder but i want the file only in Account and Department folder

How i can achieve this

Hi

you can try something like this “Directory.GetFiles(“folderPath”)”, it will read only that particular folder

Thanks…

GetFilesUnderRootFolders.zip (19.8 KB)
Hi,
We have to go through the folders to get the files. Please find the attached workflow file

I hope it helps., Mark as Solution if it works

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.