[thelist] sorting recordset problems

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Wed Jan 4 14:09:19 CST 2006


I'm sure this isn't too likely, but any chance you can have them change the file names?

If you can make assumptions about the filenames always being the same length (same number of month and day characters, etc), you could always parse them and take the pieces you want...

 From: "Pringle, Ron" RPringle at aurora-il.org

Hello all-

Using classic ASP/VBScript, I've created a recordset using FileSystemObject
to grab a listing of PDFs from a directory. All is well and good, except I
need to sort the resulting records by part of the file name, specifically
the month and day, which are written in the middle of the file.

An example file name is: ctyJan122005agd.pdf

I need to sort by Month (most recent month first) and then by day. So if I
had two records with the names as below, they would sort with the June one
first:

ctyJun232005agd.pdf
ctyJan122005agd.pdf

Right now, all I do is create a recordset with one field called "name" which
holds the file name, and I sort it by Ascending. Obviously doesn't give me
the results I want.

Not adding the files to a recordset and simply outputting them via a loop
just gives me the files in whatever order they appear in the directory.

Any ideas or links to further reading? Not sure what to even Google for to
get an answer to this one.

Regards,
Ron



More information about the thelist mailing list