hi team,
I have a new case.
i need to find all the subfolders of subfolders.
like assume that i have folder A–inside–A1 and A2 subfolders.
Inside A1 folder their will be again 2 folder A1a and A1b
inside A1a ----A1a1 folder and A!a2 folder also.
is their any way to extract all the folders at once.
Directory.GetDirectories(“Path”)—this is help to get A sub folders only.
if any way to find please help.
Thanks.
Gokul001
(Gokul Balaji)
September 23, 2022, 3:06pm
2
Hi @manipreethi410
How about this expression to get all the subfolder
Directory.GetFiles(Environment.CurrentDirectory+"\Input\Banking Files\","*.*",SearchOption.AllDirectories)
Or You can try with For Each Folder in Folder
Regards
Gokul
2 Likes
Hi @manipreethi410
Try this expression
Directory.GetDirectories(“”,SearchOption.AllDirectories)
Regards
Sudharsan
am Using old version of uipath to use foreach folder
Gokul001
(Gokul Balaji)
September 24, 2022, 4:28am
5
Okay no Worries @manipreethi410
You can try with above expression
Use assign activity
LHS : Input1 | Array(String)
Regards
Gokul
this will help to get all files. need to get all sub folders.
Thanks in advance
Gokul001
(Gokul Balaji)
September 24, 2022, 4:49am
9
Try like this
system.IO.Directory.GetFiles(Environment.CurrentDirectory+"\Input\Banking Files\","*.*",SearchOption.AllDirectories)
Regards
Gokul
@manipreethi410
Change the folder datatype into
System.String[ array]
And check on this too
Directory.GetDirectories("",System.IO.SearchOption.AllDirectories)
Regards
Sudharsan
still the same error, do i need to download any package or import any namespace?
Sudharsan_Ka:
System.String[ array]
Have you changed the datatype of folder variable?
Sudharsan_Ka:
System.String[ array]
yes, am using array of string.
Gokul001
(Gokul Balaji)
September 24, 2022, 5:08am
14
Hi @manipreethi410
Try like the below expression
Directory.GetDirectories("Yourpath","",System.IO.SearchOption.AllDirectories)
Regards
Gokul
Error is no more but am not getting any sub folder name form this.
Try this
Directory.GetDirectories(Directory.GetCurrentDirectory)
or
Directory.GetDirectories("youFolderPath","*.*",SearchOption.AllDirectories)
Regards
Sudharsan
Gokul001
(Gokul Balaji)
September 24, 2022, 5:15am
18
Hi @manipreethi410
Check out the XAML file
GetSubFolder.xaml (6.3 KB)
Regards
Gokul
1 Like
this helped me to get 1 folder’s subfolder. i need to get subfolder’s subfolder.
is that possible?
this helped me to get 1 folder’s subfolder. i need to get subfolder’s subfolder.
is that possible?