How can i Extract the entire folder hierarchy and files names inside and put it into a excel file ??
Hi @Soudios ,
You can use
Path.GetFileName(folder.ToString)
to get all sub folder
Path.GetFileName(file.ToString)
to get all file
my code
list_file_and_folder.xaml (18.6 KB)
my output
test.xlsx (8.4 KB)
you can edit location write with your requirement
if write in one column is easier
regards,
LNV
arr_folders=directory.getdirectory(“Mainfolderpath”)
Gives you the entire folders in the main folder
inside use
For each activity inside
use
assign activity
path.getfilename(currentitem).tostring Gives you the each filename inside all the folders
this is what i need, i don’t need path juste the folder and file name
refer to:
Directory.GetFiles(MyDirPathVar,"*.*",SearchOption.AllDirectories)
New DirectoryInfo(MyDirPathVar).GetFiles("*.*",SearchOption.AllDirectories)
Each loop write to a column, same my code
ouput:
you can add title before write, and don’t need +index to write
the format isn’t what i want its not really clear, is it possible to have this format :
Yes, change index and create column name before write file and folder name
do you have an exemple plz ?
Ok. I will edit with your format, then send to you
there is 2 xaml files and no invoke activity which one is the good one ?
This information is not fix, it can change, maybe next day a new file can be added
then you need to add another column for that file
as filename4
assign the filename to a variable and pass it to the add datarow
because you have mentioned some fixed column in the excel as your file number
Hope this helps
i found the issue, the folders are in a sharepoint folder so i need to connect to sharepoint first i think