Read Multilevel Folders

studio

#1

Hello Everyone,
I want to make a sequence to read file names from a parent folder and write the values to an excel sheet. Files present in the child folders also to be read along with the parent folder files. Can somebody please guide me on how to make the sequence. I also need to write the file type information while reading the file name. Thank you.


#2

If you know recursive functions, best logic for your business case.


#3

hi @skini76

I am new to UI Path with no background in programming. I have just started to learn. Could you please help me with a sample sequence? Thank you .


#4

Hi @rakesh_seeram,

You have to declare a string array variable and inside an assign activity do this code to that variable.

Directory.GetFiles(targetDirectory, “*.txt”, SearchOption.AllDirectories)

This will give you all the files from all the sub directories in side that directory.


#5

Please find the attached workflow, run the parent.xaml, check the console for the list of folders and filenames, instead of console you can write this into a excel file. Parent.xaml (8.2 KB)
Child.xaml (7.4 KB)
GetFiles.xaml (6.2 KB)