Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Directory Listing Sort Order?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 08 August 2007 :  18:38:25  Show Profile  Visit MaD2ko0l's Homepage
hiya,
what i am doing is getting a list of files and subdirectories and there contents and listing them using FSO but as u may well know it isnt sorted in any perticular way.

what i was to do seems complex in my mind.

so what happends is that when someone uploads a file to a directory it renames the file to somthiung like this: 5_200708081929220.jpg
the firest number is the memberID followed by the "_" as a seperator and then the rest is the date/time that the file was uploaded wit ha number of 0-5 before the file extention which corresponds to the number of file was uploaded at the same time.

so what iwant to do is sort the files by the date specifyed in the file name.

i have done some googleing and have came up with some ways to sort by a few things but not how i want it to be done.


can anyone help me with this litlle problem i have? or is it a case of Deal With it?

thanks

MaD2ko0l

© 1999-2010 MaD2ko0l

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 08 August 2007 :  19:28:53  Show Profile  Visit HuwR's Homepage
I think you will have to deal with it, unless you fancy writing a pretty complex sorting algorythm that sorts based on part of a filename.
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 08 August 2007 :  23:11:12  Show Profile
Why not change the filenaming scheme so the date part starts the filename? That's what I do for myself manually to keep files in chronological order.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 09 August 2007 :  13:31:20  Show Profile  Visit MaD2ko0l's Homepage
i wanted the files to be ordered by the date that they have been uploaded.

© 1999-2010 MaD2ko0l
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 09 August 2007 :  14:22:02  Show Profile  Visit HuwR's Homepage
well, if you do as Doug suggested and remove the prefix, you could then use one of the examples on this page http://classicasp.aspfaq.com/files/directories-fso/how-do-i-sort-a-list-of-files.html

or here

http://www.roubaixinteractive.com/PlayGround/FSO/Sort_Folder_Contents.asp
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 09 August 2007 :  17:38:27  Show Profile  Visit MaD2ko0l's Homepage
ok...thanks for all the help..i will have a look and see what i can come up with that works the best for me

© 1999-2010 MaD2ko0l
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07