How to get all file paths in the folder

How to get all file paths in the folder.
(I don’t know how many layer/folders in the folder)
Return the file path with a array.
Thanks

Hi,
Try with directory.getfiles(“folderpath”) In asign activity.This will give you list of files inside the folder

Let us know if this helps,
Regards,
Pavan H

get all file paths
Like this:
c:\A\A1
c:\A\A2
c:\A\A3
c:\B\B1
c:\B\B2
c:\B\B3
Thanks

Hi,
Can you close the loop it will help others aswell

I’m so sorry that I didn’t get your idea

Hi,
Please mark the the answer as solution so that others if faced the similar issue will look into this and resolve their issues

Regards,
Pavan H

I think you didn’t solve my question.
Maybe it need to use Recursive.

directory.getfiles(“C:\”) can’t return this:
c:\A\A1.xlsx
c:\A\A2.xlsx
c:\A\A3.xlsx
c:\B\B1.xlsx
c:\B\B2.xlsx
c:\B\B3.xlsx

For this you need to add the extension also
Like directory.getfiles(“C:”, “.xlsx”)
This will return you as you expected

Let us know if this helps,
Regards,
Pavan H

I don’t know how much folder in C:.
I don’t know how much file in C:\A.
I don’t know how much file in C:\B.

Hi,
If you know the path of the folder you can extract the files from there.

Regards,
Pavan H

Hi,
Or you can try with path exists activity and change to folder in property and if the folder exists then you can use directory.getfiles(“folderpath”, “extension if any”)
Let us know if you can use this logic.
Regards,
Pavan H

image

Is there one sentence to get all of these file path?

Hi @jmy,

Refer the below post for your reference and close one topic as you have created duplicate post.

2 Likes

Thank you very much!
the solution are as follows:

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