Well, file names are strings. Can you name the files such as:

0001.sql
0002.sql
Etc 

???
If not, perhaps you could copy them to a folder with those names, then
run them in order, then delete them.

BOb

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Griffin
Caprio
Sent: Thursday, May 03, 2007 4:56 PM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Sorting fileset

Hello all,

I am trying to iterate through a directory of files that are  
numerically named:

1.sql
2.sql
...

Using the foreach task is easy:

<foreach item="File" property="loop.filepath">
       <in>
         <items>
           <include name="**.sql" />
         </items>
       </in>
       <do>
         <echo message="${loop.filepath}"/>
       </do>
     </foreach>

However, this returns the list of files, sorted in text fashion, not  
numerically.  For example, if 10.sql was in the directory, it would  
be returned before 2.sql.  Obviously, since these files need to be  
run in order, this won't do.

Is there anyway I can accomplish this?

Thanks,
Griffin Caprio






------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to