Jump to content

Recommended Posts

Posted (edited)
 
 
Hi guys, I have an array as the picture. I want to find exactly location of cell with infomation "Col 3 = 50$" and "Col 15 = Waiting".
 
And, if array have 500.000 row, this code is still working ?
 
 
 
 
Có thể là hình ảnh về sơ đồ tầng, bản thiết kế và văn bản cho biết 'vùng: Row B No Col2 Brand Keyword Col3 Point TOP1 Col4 Money (Money Col5 Col6 Nham24 Col7 Col8 5 Nham24 booking Nham24 Nham24 Food TOP3 Col9 6 Col10 TOP4 Col11 205 205 505 0.2 Col12 0 TOP6 Col13 x Col14 205 Col15 9 Food App GoodFood Food App Phnom Penh Cambodia Cambodia TOP8 15S TOP10 205 0.2 1 0.2 Status Paid 0.2 155 155 305 155 15S 305 Done 0.2 0.6 06 0.2 85 85 155 85 0.1 0.1 0.1 03 0.3 0.1 0.5 205 Done Done Waiting Done Done 0.5 105 Copy 0.3 Hdr/ Row Copy Only'
 

tess1.png

Edited by kctvt
Posted
5 minutes ago, kctvt said:

I want to find exactly location of cell with infomation "Col 3 = 50$" and "Col 15 = Waiting".

Simply iterate over all elements (code only from the head - without testing):

; your array definition
$aData = ....

For $i = 0 To Ubound($aData) - 1
    If $aData[$i][3] = "50$" And $aData[$i][15] = "Waiting" Then
        MsgBox(0, "Found", "Row number: " & $i)
        ExitLoop
    EndIf
Next

 

6 minutes ago, kctvt said:

And, if array have 500.000 row, this code is still working ?

It runs - but is correspondingly slow.
If you sort by one of the two columns, you could use a modified BinarySearch to speed up the whole thing significantly.
Or you create an index that holds the search values in 2 columns and in a 3rd the row number in your output array.
The whole thing sorts by the first two columns.
You can then perform a binary search again, which works very quickly.

But basically you should forget all this because, if I look at the data and its size, a database-based solution would probably be the best approach for you.
AutoIt already includes support for SQLite.

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
×
×
  • Create New...