Shocker Posted February 13, 2016 Share Posted February 13, 2016 Hi there, use FileListToArrayRec(1,1,1,2) to find 2 Files from different Folders. Array returns [0]|2 [1]|D:\MyProg\Folder\1\xyz123.txt [2]|D:\MyProg\Folder\2\xyz124.txt although second Filename is bigger than first one. Is there a simple way to correct that or only with _ArrayColInsert(), String splitting, _Arraysort(), _ArrayColDelete() etc.? Thx 4 reply Link to comment Share on other sites More sharing options...
Jfish Posted February 13, 2016 Share Posted February 13, 2016 I am not super familiar with this function and not sure I fully understand your question but looking at your function (which we'll assume starts with a path that you omitted) the last parameter is sort. I would expect 123 to come before 124 if you sort the results. If you want 124 to come before 123 try turning off sorting by using 0 for last parameter instead of 2. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Shocker Posted February 13, 2016 Author Share Posted February 13, 2016 Thx 4 reply! Didn't work, return same sequence like #2 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 13, 2016 Moderators Share Posted February 13, 2016 Shocker, I wrote the _FileListToArrayRec UDF and what you see returned is exactly what I would expect to see when you have set the $iSort parameter. I am unsure what you mean by: Quote second Filename is bigger than first one as the UDF sorts alphabetically and thus folder 1 comes before folder 2 - the filenames are only sorted inside their respective folders. So if you want to sort on filename regardless of the earlier path, you will indeed have to do something like you suggested in the OP. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Skysnake Posted February 17, 2016 Share Posted February 17, 2016 @Melba23, does this mean that the 'filename' is the only sort 'column'? Where other 'columns' are ignored? Perhaps the Help File just needs a few extra words? Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 17, 2016 Moderators Share Posted February 17, 2016 Skysnake, Quote $iSort - [optional] Sort results in alphabetical and depth order When sorted, the UDF returns the list sorted as if you had copied it from Explorer - each level of the path is sorted separately and then the contents of that level are further sorted. So you get a final result like this: Folder A --------- File A --------- File B Folder B --------- SubFolder A --------------------- File A --------------------- File B --------- SubFolder B --------------------- File A --------------------- File B Folder C --------- File A --------- File B So all the elements of the path are taken into consideration - which is why in the above example Folder 1 comes before Folder 2. As there is only a single file within each of them there is no further sorting required - if there were more then the files within each folder would be sorted separately. Clearer? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Skysnake Posted February 17, 2016 Share Posted February 17, 2016 Fantastic. Thank you kindly. Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now