Jump to content

Filesearching question


 Share

Recommended Posts

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(*.*)

Thanks

Yeoh

Link to comment
Share on other sites

#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 by jdelaney
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

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...