DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: sort a directory listing of full paths by the value in the 3rd subdirectory  (Read 4,751 times)

questorfla

  • Fighting Slime all the Time
  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
Is there a script of utility to do this easily?
I have a text list of 100 directories I need to alphabetically sort them all by the value in the 3rd level subfolder only

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Import into a spreadsheet with \ as the delimiter, sort on the requisite column, then export as text with \ as the separator.

So goes the theory, (which works here).

You'll probably get a few lines with trailing multiple \ which can be easily removed by loading into an editor, (eg. Notepad2-mod), and doing a RegEx Search/Replace:

Search: ^(.*?)(\\+)$
Replace: \1
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: January 22, 2015, 04:00 AM by 4wd »

questorfla

  • Fighting Slime all the Time
  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 570
Hey 4wd!  Do me a BIG favor and tell me what the heck is going on from my other posting as that is a serious bug that a whole bunch of people here are trying to figure out.  If I was to make a wild guess I would say it is a "practical joke" virus loaded into Java but the issue is getting hot and i seriously have no idea how it could be happening. 

Thanks for the sort routine .  I will try it as soon as I can get this "12 hours in the future" Mal-ware or whatever it is figured out.
This re: the posting for the "website time issue" someone brought up today.  My final post I think only Shades has posted an opinion  Unfortunately he isn't quite getting the question and i know it is because somehow I am not stating it right.    It isn't a time zone thing and the systems are synced 100% correctly tot he Time.Windows clock.  The files even display the correct time on my local screen when i look at them in the folder.  But when they display in a browser they have suddenly time-shifted by 12 hours into tomorrow.  It almost has to be something to do with the software that puts the directory display on the web but I can;t find any place I can see this happen. 

Original address: https://www.donationcoder.com/forum/index.php?topic=40071.0