Power Query How to list folder names only NOT files

Joyner

Well-known Member
Joined
Nov 15, 2005
Messages
1,202
Hello, I am fairly new to Power Query and have searched but can't find a solution - every thing I find is related to listing files, not folders. Is it possible for power query to just list folder names from a path? I can list all files with the path and extract the folder name but removing the duplicates with the voluminous files is taking way too long for some reasons, so if I can just list the folder names instead of all files should be much faster.

Thank You
 
Sandy, I wasn't sure how this got added and what it does.

Folder PathLevel
D:\BaseFolder
1​
D:\BaseFolder\Folder1
2​
D:\BaseFolder\Folder2
2​
D:\BaseFolder\Folder2\Folder2.1
3​
D:\BaseFolder\Folder2\Folder2.1\Folder2.1.1
4​
D:\BaseFolder\Folder2\Folder2.1\Folder2.1.2
4​
D:\BaseFolder\Folder2\Folder2.1\Folder2.1.3
4​
D:\BaseFolder\Folder2\Folder2.1\Folder2.1.3\Folder2.1.3.1
5​
D:\BaseFolder\Folder2\Folder2.2
3​
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Thanks Sandy, that works, but wish there was a way to automate the hyperlinks with Power Query - maybe next version...
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top