rootx Posted September 16, 2016 Share Posted September 16, 2016 (edited) HI friends, I would order this array, starting from the name of the last folder. My situation... My file ini [C:\program\room\p\file.exe] [E:\program\room\a\file.exe] [D:\program\room\m\file.exe] Goal.... sort by last folder! a-m-p Any Idea, THX $ini = @ScriptDir&"\ini.ini" $aArrays = IniReadSectionNames($ini) For $i = 1 To UBound($aArrays)-1 ConsoleWrite($aArrays[$i]&@CRLF) ConsoleWrite(StringRegExp($aArrays[$i],'.*\\(.*)\\',1)[0]&@CRLF) Next Edited September 16, 2016 by rootx Link to comment Share on other sites More sharing options...
AutoBert Posted September 16, 2016 Share Posted September 16, 2016 Însert a Col and assign the wanted data to the new elements. After sort the array #include <Array.au3> $ini = @ScriptDir&"\ini.ini" $aArrays = IniReadSectionNames($ini) _ArrayColInsert($aArrays,1) For $i = 1 To UBound($aArrays)-1 $aArrays[$i][1]=StringRegExp($aArrays[$i][0],'.*\\(.*)\\',1)[0] Next _ArraySort($aArrays,0,1,0,1) ;_ArrayColDelete($aArrays,1) _ArrayDisplay($aArrays) If inserted col isn't needed you can delete it rootx 1 Link to comment Share on other sites More sharing options...
rootx Posted September 16, 2016 Author Share Posted September 16, 2016 (edited) THX very good solution, I always do it in sql!! Fridayyyyyyy to complete..... #include <Array.au3> $ini = @ScriptDir&"\ini.ini" $aArrays = IniReadSectionNames($ini) _ArrayColInsert($aArrays,1) For $i = 1 To UBound($aArrays)-1 $aArrays[$i][1]=StringRegExp($aArrays[$i][0],'.*\\(.*)\\',1)[0] Next _ArraySort($aArrays,0,1,0,1) _ArrayColDelete($aArrays,1,true);<------------------ _ArrayDisplay($aArrays) Edited September 16, 2016 by rootx 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