ericyeoh Posted November 7, 2015 Share Posted November 7, 2015 Hi, Is there any alternative to perform searching on file from (Max to min) in a particular folder.For instant, a folder consist multiple file and started with alpha "w"w100, w50, w1 , w10000, w53, w66 and so on.How possibly i can get the max and min by for alpha stared with "w" using the search engine?First i have set the destination FileselectFolder("". "destination")Local $hsearch = FileFindFirstFile(*.*)ThanksYeoh Link to comment Share on other sites More sharing options...
jdelaney Posted November 7, 2015 Share Posted November 7, 2015 (edited) #include <Array.au3> ; imagine this populated from _FileListToArray Local $a[5]=["w100","w50","w10000","w53","w66"] Local $temp[UBound($a)][2] For $i = 0 To UBound($temp)-1 $Temp[$i][0]=$a[$i] $Temp[$i][1]=Number(StringRegExpReplace($a[$i],"(w)","")) Next _ArraySort($Temp,0,0,0,1) ; repopulate...or just use Temp moving forward For $i = 0 To UBound($Temp)-1 $a[$i] = $Temp[$i][0] Next _ArrayDisplay($a)output:[0]|w50[1]|w53[2]|w66[3]|w100[4]|w10000 edit: oops, max to min would use this sort instead:_ArraySort($Temp,1,0,0,1)THAT output would be:[0]|w10000[1]|w100[2]|w66[3]|w53[4]|w50 Edited November 7, 2015 by jdelaney ericyeoh 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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