Sort by file/directory like explorer

N

NikiB

Hi,
I have a heap of files with their full directory paths and would like to
sort them in a tree structure. For example, sort the file names out first
then by the directory names.
So where I have the following in my list:
Candle/Candle.txt
Corn/Corn.txt
Delivery/Delivery.txt
Eggs.txt
Ham.txt
Open/Open.txt
Sandwich/Sandwich.txt
Service/Service.txt

i would like them to be sorted like this:
Eggs.txt
Ham.txt
Candle/Candle.txt
Corn/Corn.txt
Delivery/Delivery.txt
Open/Open.txt
Sandwich/Sandwich.txt
Service/Service.txt

Any help appreciated
 
J

Jim Thomlinson

Have you tried to use text to columns (Data -> Text to Columns) to split out
the directory path into seperate cells. You can then sort the individual
columns that contain the path to achieve what you want...
 
D

Dave Peterson

I would use data|text to columns, delimited by the backslash and separate each
piece of the file name into separate columns.

Then I could sort by the columns I want (maybe multiple times if the number of
levels is larger than 3).
 
N

NikiB

I understand what you mean but I have several lists which need to be sorted
this way on their own. I wanted to avoind having to do manual sorting with
the sheer volume of information I have! Any other ideas?
 
N

NikiB

thanks, I understand what you mean but I have many lists that i wish to sort
in their own right and would prefer if there was no manual intervention! Any
other ideas?
 
D

Dave Peterson

Record a macro when you do it once and reexecute that macro for the other
worksheets.
 
N

NikiB

thanks, I understand what you mean but I have many lists that i wish to sort
in their own right and would prefer if there was no manual intervention!
Previous response had already suggested I use that method :) Any
other ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top