The only thing I can think of is to add a new QueryColumn and use
ListLast(Filename, �_�) as the new columns value then sort by that� or
rename your files to something like�

File_001

File_002

File_003

File_010

File_020

File_030

<cfloop query=�GetAllFIles�>

<cfset NewFile = "File_" & NumberFormat(ListLast(name, "_"), "000")>

<cffile action="" source=�#serverdir##docpath#\#name#"
destination=�#serverdir##docpath#\#newfilename#">

</cfloop>

Just use a larger mask if you think there will ever be more than 100 files
(000) or a file name greater than FILE_100

-OR-

You could just sort by the date attribute if those files were created in
sequential order : )

   _____  

From: Mark Henderson [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 23, 2004 11:53 PM
To: CF-Talk
Subject: File names not correctly ordered

hrmm..I just noticed in my output after a directory query, when displaying
files it orders them as follows...
file_1
file_10
file_2
file_20
file_3

etc etc,
instead of the preferred
file_1
file_2
file_3
file_10
file_20

I know how to correct this when dealing with *just* numeric info, but not
with letters and numbers.

My queries are pretty straightfoward...
<cfdirectory
  name="getAllFiles"
  action="">   directory="#serverdir##docpath#"
  sort="name ASC">

<cfquery dbtype="query" name="getAllFiles_#docpath#">
  SELECT *
  FROM getAllFiles
</cfquery>

Any ideas on how to sort this out??

Regards

Mark H

   _____  

[HYPERLINK "http://www.houseoffusion.com/lists.cfm/link=t:4"Todays Threads]
[HYPERLINK "http://www.houseoffusion.com/lists.cfm/link=i:4:179599"This
Message] [HYPERLINK
"http://www.houseoffusion.com/lists.cfm/link=s:4"Subscription] [HYPERLINK
"http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=678.598.4"Fast
Unsubscribe] [HYPERLINK "http://www.houseoffusion.com/signin/"User Settings]
[HYPERLINK
"https://www.paypal.com/cgi-bin/webscr?amount=&item_name=House+of+Fusion&bus
iness=donations%40houseoffusion.com&undefined_quantity=&cmd=_xclick"Donation
s and Support]

   _____  

HYPERLINK "http://www.houseoffusion.com/banners/view.cfm?bannerid=11" \n

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.767 / Virus Database: 514 - Release Date: 9/21/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.767 / Virus Database: 514 - Release Date: 9/21/2004
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to