Jump to content

File name sort problem


Tonych
 Share

Recommended Posts

Hi, everyone!

I have some files like these: 2, 4, 10, 12, 20, A2, A10, A20-1, A20-2...

In Windows explorer, it displays very well. When I try to read them in AutoIt ( use _FileListToArray or FileFindFirstFile), there is a problem that they are sorted like these: 10, 12, 2, 20, 4, A10, A2, A20-1, A20-2...

How can I get the same way like in Windows XP? Thanks in advance!

Link to comment
Share on other sites

You should read the files to an array and use a natural sort algorithm, e.g.: http://www.autoitscript.com/forum/index.ph...hl=natural+sort

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...