How to sort folders by last characters of folder name in Windows 7?

1

1

I have a stack of client folders with names like this:

eastcoal 008
mee 022
orr 047
owaka 032
owen 025
powernet006
redpath 031

Normally this works, but sometimes I'd like to sort by the number. So how can I sort folders by the last characters in the folder string? Characters will always be three consecutive numbers, and will run from 001 to 999 (until I've done a thousand jobs, which will take years).

nigelc

Posted 2013-03-26T01:31:19.253

Reputation: 167

I can't think of a way to do this, but if you are creating the jobs, why not create a folder for each client, and number the jobs inside each folder, with the number at the front. – Paul – 2013-03-26T01:56:55.187

Is it necessary to have names at beginning ? Otherwise we can use some kind of Script to rename all folders to bring numbers at front. – Ankit – 2013-03-26T06:53:41.397

Answers

2

This can be done from a command prompt, but I can't think of any way to do it in Explorer.

Name the folders name.### where ### is a three digit number. For example, I created these folders.

ann.023 
bob.002 
fred.001 
harvey.012

From a command prompt or in Explorer the names will sort based using the first character, etc.

C:\test>dir
 Volume in drive C has no label.
 Volume Serial Number is 60B7-B1BA

 Directory of C:\test

2013-03-25  10:21 PM    <DIR>          .
2013-03-25  10:21 PM    <DIR>          ..
2013-03-25  10:21 PM    <DIR>          ann.023
2013-03-25  10:21 PM    <DIR>          bob.002
2013-03-25  10:21 PM    <DIR>          fred.001
2013-03-25  10:21 PM    <DIR>          harvey.012

From a command prompt you can also sort by extension (the part after the .) using dir /oe which gives this result.

C:\test>dir /oe
 Volume in drive C has no label.
 Volume Serial Number is 60B7-B1BA

 Directory of C:\test

2013-03-25  10:21 PM    <DIR>          ..
2013-03-25  10:21 PM    <DIR>          .
2013-03-25  10:21 PM    <DIR>          fred.001
2013-03-25  10:21 PM    <DIR>          bob.002
2013-03-25  10:21 PM    <DIR>          harvey.012
2013-03-25  10:21 PM    <DIR>          ann.023

That's only a partial solution as you have to go to the command prompt to get the alternate sorting method. However, if you only need to do it occasionally then perhaps it's good enough.

Wayne Johnston

Posted 2013-03-26T01:31:19.253

Reputation: 3 416

In Explorer you can also sort by (folder) file extension - just click on the "Type" column. Whilst Explorer doesn't explicitly show the extension/type - it simply shows "File folder" in the type column (unlike files) - sorting still appears to work. – MrWhite – 2019-02-22T15:03:28.687

Thank you Wayne, that'll do fine for what I need. I only need to do this about once a fortnight. Now I just need to get DOS working on my win7 machine and I'll be all set – nigelc – 2013-03-26T20:18:40.703

Click the Start button, type cmd in the search box, and press enter to open a command prompt. – Wayne Johnston – 2013-03-26T23:56:44.810